Jump to content
  • Advertisement
Sign in to follow this  
thatguyfromthething

Find perpendicular ray to a plane in point normal form?

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

I have a plane defined as a point and a direction vector from that point. I need to find any vector perpendicular to the plane's direction vector. I know the dot product has to be 0 between them, but I am not sure how to make sure that is the case.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
I have a plane defined as a point and a direction vector from that point. I need to find any vector perpendicular to the plane's direction vector. I know the dot product has to be 0 between them, but I am not sure how to make sure that is the case.
Here's the method I'd recommend:

1. Identify the element of the plane normal with the least magnitude.

2. Take the cross product of the plane normal and the cardinal basis vector corresponding to this element.

3. Normalize the result.

As an example, say the plane normal is [-1, 2, -5]. (I'm using a non-unit-length normal here just for convenience.)

The magnitudes of the elements are 1, 2, and 5. The element with the least magnitude is the first element, x. Therefore, we cross the normal with the cardinal x axis, [1, 0, 0], and then normalize the result.

By crossing with the basis vector corresponding to the element with the least magnitude, we ensure that the result will be valid and that the normalization will be stable (that is, we won't be trying to normalize a vector with a small magnitude).

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!