Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

svpace

rendering and collision colliding

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, this is probably one of these questions that has been beat to death but I will ask it anyway. I am doing a (very) small game using a couple of articulated figures and rendering then with a (even smaller) scenegraph, something like: push>transform>draw>push>transform>draw>pop>transform>draw>... now it''s time for the big bad and ugly collision detection, but my figures are composed by parts that know position and direction based on their parents position and direction and that''s unsuitable for collisions. My first solution was to retrieve the transformation matrix (I using OpenGL by the way) and applying it to the vertices but it seens I''m repeting GPU job and NVidia docs tell that getting information out of the gpu is very inefficient. mantaining a local tranformation matrix seens to kill the gpu purpose. There is anyway to handle rendering and collision in the same structure, avoiding CPU vector math?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
maintain the transform matrixes yourself with the cpu. the gpu isn''t much faster for plain matrix multiplication. what the gpu does fast is transforming all the vertices by the current matrix.

Share this post


Link to post
Share on other sites
indeed, but i will need the transformed vertices to detect collision, so I still will need to repeat gpu (heavy)job

Share this post


Link to post
Share on other sites
You could keep a copy of the model-to-world space transformation matrix, then do collision detection based on things besides the polygon soup, such as ellipsoids (bounding spheres), among other things. Then you won''t have to transform every single vertex.

Share this post


Link to post
Share on other sites
that is my best bet for now, but I''m not really satisfied with that, there should be some way to avoid this redundancy

Share this post


Link to post
Share on other sites
When it comes to testing for collision between two objects the last thing you want to have to do is transofm an collision object from local space to a game objects position in world space. If you are attempting to detect collision with a simple object such a shere, box, ray or so on with the polygons of a collision mesh then you would be better to transform the simple object in to the collision meshes local space. To do this you must transform the object in world space by the the inverse world transformation of the game object / Collision mesh and then continue to test for an intersection as normal.
For mesh to mesh collision you are better to use some hierarchical scheme of subdividing polygons and discard section that might intersect before transfroming individual polygons and vertices into a new co-ordinate system. An AABB Tree can be used to group polygons or sets of polygons in a mesh into groups. Once this is done it should be possible to discard sections of a mesh from detailed intersection tests

[edited by - Twon on March 6, 2004 4:09:45 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!