Archived

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

Collision Detection and Plane Equation

This topic is 5590 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

Hello, First off before anyone flames me, I read many articles and looked through prior posts on Math & Physics and in the DirectX forum. Anyways my first question is, The plane equation: Ax + By + Cz ( + | - ) d = 0; D is the plane''s distance to the origin .. what Origin? (0,0,0)? ( If it''s the dotproduct of the normalized vectors (ABC and xyz) I know how to get that value - otherwise I''m really confused on this aspect ) Next is, I know how to do collision detection but my issue is - say I''m walking around my world ( 3D ) How do I know which polygon face I should be testing my bounding sphere ( or box ) with? A world would have thousands of faces to test against, how will I know which one to target? I.e. walking forward then I hit a wall north of me instead of South East? Thanks for your time, David

Share this post


Link to post
Share on other sites
When you have the equation Ax + By + Cz - D = 0, you know that using the coordinates (x,y,z) of ANY point on the plane it must be equal to zero.

Then, to get the D value you may just use one point on plane:
D = Ax + By + Cz.

In other words, D is the dot product of the plane''s normal (A,B,C) and any plane''s point (x,y,z). And, yes, it''s the distance from (0,0,0).

When you are working with large worlds, you must use a way to organize all the polygons (BSP, Octrees, Portals). Not just for rendering, but for collision detection too.

Share this post


Link to post
Share on other sites
"When you are working with large worlds, you must use a way to organize all the polygons (BSP, Octrees, Portals). Not just for rendering, but for collision detection too. "


Ah very nice, just thought bsp/octrees/portal/and such were just for rendering much thanks to you!



Thanks!

Share this post


Link to post
Share on other sites