Jump to content
  • Advertisement
Sign in to follow this  
MegaBoomer

Question about planes

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

Advertisement
sorry but I afraid you can't draw a plane because it's area is infinite...
maybe you can draw a large rectangle instead.

Share this post


Link to post
Share on other sites
ax + by + cz + d = 0

gives

z = (-ax - by - d) / c

Pick 4 points in the x-y-plane and use the above equation to calculate the four corresponding z-values for the plane on that points, create a quad from those points and render and there you have part of a plane.

To render the normal just pick a point on the plane and draw a line from that point to a point on the line formed by that point and the normal vector.

Share this post


Link to post
Share on other sites
Quote:
Original post by Enselic
ax + by + cz + d = 0

gives

z = (-ax - by - d) / c

Just for completion: Obviously there is a need of case distinction, since the 2nd formula doesn't work for planes where c is 0 or at least near to 0. You may use the maximum of the absolute |a|, |b|, and |c| to determine which case best to use, like so:

max(|a|,|b|,|c|) == |a| => x = (- by - cz - d) / a
max(|a|,|b|,|c|) == |b| => y = (- ax - cz - d) / b
max(|a|,|b|,|c|) == |c| => z = (- ax - by - d) / c

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!