Jump to content
  • Advertisement
Sign in to follow this  
dktime

k-dop visualization

This topic is 3476 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 I was looking for a solution for visualizing k-dop bounding volumes and came across the thread http://www.gamedev.net/community/forums/topic.asp?topic_id=477374. It's been closed and I have since made a working k-dop visualization and thought I would add it to the kb. 1) The first section is correct though I found it easier to use an explicit representation for calculating the intersection of three planes (see http://mathworld.wolfram.com/Plane-PlaneIntersection.html) 2) There is a bug here. You should test if the scalar projection of the point along the plane normal is greater-than NOT less-than the dop-projection. Also be sure to use absolute lengths in case you have negative distances for your bounding volume. (ie bvMin = -1, bvMax = +1) 3) As for finding an ordering of the points on each plane for drawing purposes, I kept track of which points were attached to which planes like the poster did. I then transform the 3d plane into a 2d plane. I take the closest point to plane and pick any point on the plane and set that to one axis. Then cross the normal with that vector to get the other. Build a transformation matrix with these axes and also calculate it's inverse for later. Then I run a Graham scan convex hull algorithm on these points to get the ordering. (Since all points are on the hull you really only need to do the initialization steps of a Graham scan - that is pick an extreme point and order the points in some polar direction). Once you have the ordering use the inverse transform to get the points in the original coordinate system. Draw however you want. Hope that helps somebody down the road. S

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!