Jump to content
  • Advertisement
Sign in to follow this  
Basiror

translating a plane

This topic is 4819 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 am working with convex brushes in my engine where I store each face as a plane and do planeintersections to rebuild the brush after a transformation now if i want to translate the brush can i simply transform the plane list this? dist = plane.distance(translationdir); plane[3] += dist; ?? actually translating a plane isn t anything else than moving the point that hold the plane by translation dir

Share this post


Link to post
Share on other sites
Advertisement
I think your last idea is correct. And if I'm not mistaken once you work through the math it will reduce to:

plane.distance += translation.Dot(plane.normal);

There are ways to transform planes using matrix multiplication, I believe, but the above should work for simple translations.

Share this post


Link to post
Share on other sites
Depends how your plane is stored. If you store it as three points, then yeah just translate them all by the translation vector. But if you use the normal-distance format (which I'm personally a big fan of, as my other posts can attest to), then the distance increase is based on the angle between the normal vector and the translation vector. Basically, take the dot product between the translation vector and the normal vector, and increase your distance by that. And viola, your planes are translated.

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.

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

Sign me up!