OpenGL VBO & Collision?

Recommended Posts

This is about collision detection but still related to openGL. I recently implemented VBO's into my code which is fantastic. But I've been looking into the many common collision detection algorithms out there and found myself questioning how to store or deal with the data. Either a) I need to do the collision detection on the GPU or b) I need to access the mesh data for collision on the GPU to calculate it externally or c) I need to store 2 seperate sets of data (one for rendering, one for collision) Any suggestions would be appreciated on how to do this. I'm currently looking at sticking to bounding spheres and then just per polygon collision. Thanks.

Share on other sites
collision detection is usually not handled on the gpu (and it would be slow anyway)
the nomral method is c have a render mesh + a collision mesh, usually the collision mesh is simplified eg done with a sphere or like in quake3 halflife etc a few boxes

Share on other sites
Cheers... now I guess one more question which is a bit further off from this... and I realize it doesn't directly relate to openGL but its part of the same problem I'm dealing with so I hope its okay. (oh, also, I took at look at your site zedzeek, game looks good man!)

Theres a few articles I've read on ellipsoid collision. The one I'm interested in specifically is one by Kasper Fauerby. He explains with the example of an FPS. Using a ellipsoid to be more accurate as a bounding shape for a human, and then converting everything to ellipsoid space in order to just work with spheres.
(Hope this makes sense, but basically if the ellipsoid is 3, 4, 5, you change your basis for everything to match that)

In my mind, this does not take into account if the ellipse rotates. in my case the object follows the terrain (a vehicle that fits in an ellipse) so it will rotate on all axis (potentially)... so I would figure you need to rework all verts relative to the rotation.

I hope this makes some sense... its hard to explain. Again advice is appreciated.

Share on other sites
Quote:
 Original post by greyrootTheres a few articles I've read on ellipsoid collision. The one I'm interested in specifically is one by Kasper Fauerby. He explains with the example of an FPS. Using a ellipsoid to be more accurate as a bounding shape for a human, and then converting everything to ellipsoid space in order to just work with spheres.(Hope this makes sense, but basically if the ellipsoid is 3, 4, 5, you change your basis for everything to match that)

The first "edition" of that paper overlooked the edge and verctor collision cases which at least on my implementation caused the algorithm to explode, once I implemented edge and vector cases (using voronoi regions), the code ended too complex and in my eyes quite inelegant.
That would had been fine if it worked on all cases, however, due to the quasi-recursive nature of the algorithm (you have to run the algorithm over and over until it returns with no collisions), there were cases such as when the ellipsoid ended over a gap between 2 "walls" on which it did not fit, then an infinite loop would araise, locking the simulation.

I would instead recomend looking into AABB or capsule collision detection against a BSP, such as the one Quake 3 uses.

Quote:
 Original post by greyrootIn my mind, this does not take into account if the ellipse rotates. in my case the object follows the terrain (a vehicle that fits in an ellipse) so it will rotate on all axis (potentially)... so I would figure you need to rework all verts relative to the rotation.

Yes, rotation is not taken into consideration, and you shouldnt need it since the paper is meant for humanoid characters, which dont follow the slope of the terrain, for a vehicle, you would be better off using spheres for each wheel (4 in the case of a car) and perhaps an object oriented box for the vehicle body.

Create an account

Register a new account

• Forum Statistics

• Total Topics
627700
• Total Posts
2978699
• Similar Content

• A friend of mine and I are making a 2D game engine as a learning experience and to hopefully build upon the experience in the long run.

-What I'm using:
C++;. Since im learning this language while in college and its one of the popular language to make games with why not.     Visual Studios; Im using a windows so yea.     SDL or GLFW; was thinking about SDL since i do some research on it where it is catching my interest but i hear SDL is a huge package compared to GLFW, so i may do GLFW to start with as learning since i may get overwhelmed with SDL.
-Questions
Knowing what we want in the engine what should our main focus be in terms of learning. File managements, with headers, functions ect. How can i properly manage files with out confusing myself and my friend when sharing code. Alternative to Visual studios: My friend has a mac and cant properly use Vis studios, is there another alternative to it?

• Both functions are available since 3.0, and I'm currently using glMapBuffer(), which works fine.
But, I was wondering if anyone has experienced advantage in using glMapBufferRange(), which allows to specify the range of the mapped buffer. Could this be only a safety measure or does it improve performance?
Note: I'm not asking about glBufferSubData()/glBufferData. Those two are irrelevant in this case.
• By xhcao
Before using void glBindImageTexture(    GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness.
• By cebugdev
hi guys,
are there any books, link online or any other resources that discusses on how to build special effects such as magic, lightning, etc. in OpenGL? i mean, yeah most of them are using particles but im looking for resources specifically on how to manipulate the particles to look like an effect that can be use for games,. i did fire particle before, and I want to learn how to do the other 'magic' as well.
Like are there one book or link(cant find in google) that atleast featured how to make different particle effects in OpenGL (or DirectX)? If there is no one stop shop for it, maybe ill just look for some tips on how to make a particle engine that is flexible enough to enable me to design different effects/magic
let me know if you guys have recommendations.
• By dud3
How do we rotate the camera around x axis 360 degrees, without having the strange effect as in my video below?
Mine behaves exactly the same way spherical coordinates would, I'm using euler angles.
Tried googling, but couldn't find a proper answer, guessing I don't know what exactly to google for, googled 'rotate 360 around x axis', got no proper answers.

References:
Code: https://pastebin.com/Hcshj3FQ
The video shows the difference between blender and my rotation:

• 21
• 14
• 12
• 10
• 12