Basic collosion detection
I need help on basic collosion detection with quads ive tried loads of things and cant get it too work also how would i when the collosion occurs to remove that quad from the screen is there a delete quad function or something like that please help me
thanks for any help
Well, simple detection would be, well, pretty simple.
When you draw the quad, keep track of where on the screen it is.
And I''m sure you''re trying to detect when it gets to a certain place, so you have those coordinates as well.
If the coordinate of the quad +/- the width/height/whatever is greater/less than where you want to no longer display it, then, stop displaying it.
You don''t have to delete the quad, you just stop drawing the quad and it''ll go away (if you''re clearing the GL_COLOR_BUFFER_BIT at least, which I''m sure you''re doing, I hope)
- Mike
When you draw the quad, keep track of where on the screen it is.
And I''m sure you''re trying to detect when it gets to a certain place, so you have those coordinates as well.
If the coordinate of the quad +/- the width/height/whatever is greater/less than where you want to no longer display it, then, stop displaying it.
You don''t have to delete the quad, you just stop drawing the quad and it''ll go away (if you''re clearing the GL_COLOR_BUFFER_BIT at least, which I''m sure you''re doing, I hope)
- Mike
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement