Okay... so I've worked with 2D collisions quite a bit, and I'm wondering what are the most commonly used methods for collision in 3D? Can you apply the rectangular and circular collision concepts to a rectangular cube or sphere?
My guess... for reasonable dirty collisions I would do the best I could to define rectangular dimensions around an object and run greater than/less than boundary tests... does that sound about right?
I'm currently researching the model matrix and how to determine the new location of a vertex after it's been translated, rotated or scaled... I'm gathering I can use glGetFixed() and retrieve the GL_GET_MATRIX_POSITION to run some tests?
Collisions in 3D
Re: Collisions in 3D
When I did OpenGL 3D for Win32, I drew all my models' vertices as offsets from a central point. From there, I gauged a sphere around the model itself using a presumed radius, and every time the physics engine updated, I looped through all the models comparing them to each other, in which I had some trig in way to calculate the distance between the two central points of the comparing models, and then I added together their radii and checked if it matched/was smaller (and thus collided) than the distance
A very quick and dirty method indeed. Can kill your framerate if the scene is big enough, but very easy to deploy, and not unlike that of the 2D one either
A very quick and dirty method indeed. Can kill your framerate if the scene is big enough, but very easy to deploy, and not unlike that of the 2D one either
Who is online
Users browsing this forum: No registered users and 1 guest