• Advertisement
Sign in to follow this  

side of plane

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

Plane::Side Plane::side (const D3DXVECTOR3& point) const
{
    float fDistance = distanceToPoint(point);

    if ( fDistance < 0.0 )
        return Plane::NEGATIVE_SIDE;

    if ( fDistance > 0.0 )
        return Plane::POSITIVE_SIDE;

    return Plane::NO_SIDE;
}


it judge which side of plane is point I think it should use something like std::numeric_limits::epison() .is it necessary?

Share this post


Link to post
Share on other sites
Advertisement
I think it would make no difference - epsilon() will return very tiny number. Sticking with checks with 0 should be ok. However you may need to introduce some epsilon which you define, if you for example know that the input point may "contain" some error. But that depends on how you use the function...

Share this post


Link to post
Share on other sites
Whether you need the epsilon (and what it should be) depends on the circumstances. For example, for clipping a polygon to a plane, an epsilon is often required to avoid various robustness problems.

Share this post


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

  • Advertisement