2
votes

I have a polygon defined by n points and a polygon normal.

  • Now I want to get the plane of the polygon defined by
    • a plane normal=(nx,ny,nz)
    • and a constant d (distance from the origin to the plane).
  • The plane normal is equal to the polygon normal, but how can I calculate d?
  • desired plane equation nx*x+ny*y+nz*z+d=0.0
1

1 Answers

3
votes

Take any point p=(px, py, pz) on the plane and plug it into the equation to obtain d.

So if your equation is nx·x + ny·y + nz·z + d = 0 then you get d = − (nx·px + ny·py + nz·pz).

Another common formulation is using d as the right hand side of the equation, in which case you get the reverse sign. I.e. for the equation nx·x + ny·y + nz·z = d you get d = nx·px + ny·py + nz·pz.