Jump to content
  • Advertisement
Sign in to follow this  
Prog101

solving for plane equation

This topic is 4148 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 am trying to solve the equation for the plane ax + bx + cx = d right so i have 3 vectors const Max_Cont = 4; //each of the 4 ground plane vectores hold the values for x,yz D3DXVECTOR3 vGroundPlane[Max_Cont]; so how do i use this to get the ground plane calculation

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Prog101
i am trying to solve the equation for the plane

ax + bx + cx = d

right so i have 3 vectors

const Max_Cont = 4;
//each of the 4 ground plane vectores hold the values for x,yz

D3DXVECTOR3 vGroundPlane[Max_Cont];

so how do i use this to get the ground plane calculation

The plane equation is Ax + By + Cz + D = 0

Using 3 of your vectors you can find the normal of the plane they make giving you A, B and C so you can then just plug any of 3 verts back into the plane equation and solve for D.

Regards,
ViLiO

Share this post


Link to post
Share on other sites
If each of your ground plane 'vectors' is actually a point (I think that's likely), then pick any 3 of them; let's call them a, b, c.

The plane normal is (c-a)×(b-a), normalised, and the 'd' value for the plane equation is a.n.

Share this post


Link to post
Share on other sites
Quote:
Original post by Bob Janova
If each of your ground plane 'vectors' is actually a point (I think that's likely), then pick any 3 of them; let's call them a, b, c.

The plane normal is (c-a)×(b-a), normalised, and the 'd' value for the plane equation is a.n.



I think a.n should be -(a.n) or -DOT(a,n)

Just expanding from A(x - x1) + B(y - y1) + C(z - z1) = 0 assuming a = (x1,y1,z1)

Share this post


Link to post
Share on other sites
The sign of d depends whether your plane definition is
  (r.n) = d
or
  (r.n) + d = 0

:).

So yeah, sorry, looking at the OP's definition you are correct, your D value is -a.n.

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!