Jump to content
  • Advertisement
Sign in to follow this  

D3DXPLANE question

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

quick question: the a,b,c values of a D3DXPLANE are its normal, i got that. but I don't quite understand the d value, which I've read is its distance from the origin.. is that its distance from the origin in the direction of its normal? So if I declare a plane: D3DXPLANE plane=D3DXPLANE(0.0f, 1.0f, 0.0f, 100.0f); would that plane have the position (0,100,0)? (though I know planes don't have a position, just theoretically speaking...)

Share this post

Link to post
Share on other sites
When a plane is expressed as:

ax+by+cz = d

Or more commonly:

p.n = d

Then d can be viewed as the distance from the origin to the plane, in the direction of the plane normal.

We can also write the equation as ax+by+cz+d = 0, but note that this d is the negative of the d in the first equation. So with this form, -d is the distance to the plane along the normal.

Note that if the plane is not normalized, these distances are scaled by |n|.

In your example, the point (0,-100,0) would be on the plane, which we can show by plugging it into the equation:

0*0-1*100+0*0+100 = -100+100 = 0

So you had the right idea in your post, just backwards.

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!