Jump to content
  • Advertisement
Sign in to follow this  
edwinnie

quickhull quick question

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

hihi! I am wondering how does the author of the code for ConvexHull3 in Geometric Tools determine the ordering of extremal vertex indices when assigning them to HullTriangles to build up their adjacency information. Code Link The snippet I am looking at is:
if (kMapper.GetExtremeCCW())
{
        pkT0 = WM3_NEW HullTriangle3<Real>(i0,i1,i3);
        pkT1 = WM3_NEW HullTriangle3<Real>(i0,i2,i1);
        pkT2 = WM3_NEW HullTriangle3<Real>(i0,i3,i2);
        pkT3 = WM3_NEW HullTriangle3<Real>(i1,i2,i3);
        pkT0->AttachTo(pkT1,pkT3,pkT2);
        pkT1->AttachTo(pkT2,pkT3,pkT0);
        pkT2->AttachTo(pkT0,pkT3,pkT1);
        pkT3->AttachTo(pkT1,pkT2,pkT0);
    }
    else
    {
        pkT0 = WM3_NEW HullTriangle3<Real>(i0,i3,i1);
        pkT1 = WM3_NEW HullTriangle3<Real>(i0,i1,i2);
        pkT2 = WM3_NEW HullTriangle3<Real>(i0,i2,i3);
        pkT3 = WM3_NEW HullTriangle3<Real>(i1,i3,i2);
        pkT0->AttachTo(pkT2,pkT3,pkT1);
        pkT1->AttachTo(pkT0,pkT3,pkT2);
        pkT2->AttachTo(pkT1,pkT3,pkT0);
        pkT3->AttachTo(pkT0,pkT2,pkT1);
    }


thx! Edwin

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by edwinnie
I am wondering how does the author of the code for ConvexHull3 in Geometric Tools determine the ordering of extremal vertex indices when assigning them to HullTriangles to build up their adjacency information.


That code is not "quickhull"; rather, it builds the hull incrementally. In the code segment you posted, there is a Mapper3 object. When you look at the source code for Mapper3, its job is to determine if the point set is (nearly) degenerate (point, linear, planar). The point set is not degenerate when Mapper3 has located four non-coplanar points. These are the vertices of a tetrahedron.

Just as the vertices of a planar triangle can have two possible orderings (clockwise or counterclockwise), the vertices of a tetrahedron can have two possible orderings (clockwise or counterclockwise). The ordering is based on how the triangle faces appear to an observer outside the tetrahedron. Mapper3 determines this information, which you obtain by calling GetExtremeCCW().

Share this post


Link to post
Share on other sites
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!