Sign in to follow this  
3Dgonewild

Collecting information..

Recommended Posts

3Dgonewild    174
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 this post


Link to post
Share on other sites
jyk    2094
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 this post


Link to post
Share on other sites
3Dgonewild    174
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]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this