Public Group

# Collecting information..

This topic is 4140 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Alright ! Im about to create my first game in opengl (so far i've been reading tutorials and editing code that others wrote)!! I'll try to make a 2d beat em up (like streets of rage) , but .... with 3D BACKGROUNDS(3d camera will scroll left/right). I can do it , but , i have some questions because im still a beginner and i dont want any more mistakes !!. 1) How can i rotate a 2d object without glrotate() ? I've tried this : x=x+cos(angle) *x + sin(angle) * y; y=y+sin(angle) *x - cos(angle) * y; But its not what i want... 2) What about collision? I've heard that you can use collision boxes(boxes that are placed at every object). But that sounds bad idea , since some special 2d animated images contain special graphics (eg thunder attack etc..). And what kind of collision function i will need? Bounding box? circular ? something else? Thats all for now! , thanks for reading my message.

##### Share on other sites
Quote:
 x=x+cos(angle) *x + sin(angle) * y;y=y+sin(angle) *x - cos(angle) * y;
Here you've made the common mistake of overwriting the value of x, and then using the new value in the second equation. (The addition of x and y on the right-hand side also looks a little suspicious.)
Quote:
 I've heard that you can use collision boxes(boxes that are placed at every object).But that sounds bad idea , since some special 2d animated images contain special graphics (eg thunder attack etc..).And what kind of collision function i will need?Bounding box? circular ? something else?
Axis-aligned bounding boxes (AABBs), oriented bounding boxes (OBBs), capsules, or circles would all be fairly logical choices for a 2D fighting game. If you've got weird shapes that require very accurate collision behavior (e.g. does the 'thunder attack' actually hit the opponent), you may have to look into more complex methods such as pixel-based collision detection or the use of non-convex polygons. However, I'd encourage you to stick with simple bounding volumes wherever possible, if for no other reason than ease of implementation.

##### Share on other sites
Quote:
Original post by jyk
Quote:
 x=x+cos(angle) *x + sin(angle) * y;y=y+sin(angle) *x - cos(angle) * y;
Here you've made the common mistake of overwriting the value of x, and then using the new value in the second equation. (The addition of x and y on the right-hand side also looks a little suspicious.)
Quote:
 I've heard that you can use collision boxes(boxes that are placed at every object).But that sounds bad idea , since some special 2d animated images contain special graphics (eg thunder attack etc..).And what kind of collision function i will need?Bounding box? circular ? something else?
Axis-aligned bounding boxes (AABBs), oriented bounding boxes (OBBs), capsules, or circles would all be fairly logical choices for a 2D fighting game. If you've got weird shapes that require very accurate collision behavior (e.g. does the 'thunder attack' actually hit the opponent), you may have to look into more complex methods such as pixel-based collision detection or the use of non-convex polygons. However, I'd encourage you to stick with simple bounding volumes wherever possible, if for no other reason than ease of implementation.

First of all , thanks for the cool reply!

1)Yes, you're right , now its working....BUT its doing circles only..
glrotate() rotates the object , so i want to make something similar..

2)Nothing to ask here .. you covered all my questions...thanks!!

___________________

Some new questions (lol :)

1) Can i use "gluPerspective()" instead of ortho ??
I've tried many times , but im getting a black screen..

2) Wich is the BEST WAY to load & show an image on the screen?
So far i've been playing with 3d cubes/triangles only..

edit:
3) When you have thousands objects how can you do collision check?
A loop and an array class drops the fps dramatically...

[Edited by - 3Dgonewild on July 16, 2007 11:18:54 AM]

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5

• 13
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633325
• Total Posts
3011371
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!