Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!liuida!isy!jonas-y From: jonas-y@isy.liu.se (Jonas Yngvesson) Newsgroups: comp.graphics Subject: Re: newell plane equation Keywords: graphics, plane eqation Message-ID: <1991Mar7.163118.869@isy.liu.se> Date: 7 Mar 91 16:31:18 GMT References: <9283@exodus.Eng.Sun.COM> Organization: Dept of EE, University of Linkoping Lines: 50 stephenj@deblil.Eng.Sun.COM (Stephen Johnson) writes: >I have been using the Newell technique for computing the plane >equation in the form: >Ax + By + Cz + D = 0 >and I discovered that the plane defined by the following points is >computing incorrectly: >(2,2,0), (12,2,0), (2,2,3), (12, 2, 3) If you use the points in the above order they don't define a proper polygon but a polygon with two "loops" in it. Rather like an 8: 3*-----*4 \ / \ / X / \ / \ 1*-----*2 Such a polygon doesn't have a defined normal vector (which is what you calculate in the sums). If you change the order of the first two or the last two points your calculations will be (last two changed): A = (0 * 0) + (0 * 3) + (0 * 6) + (0 * 3) = 0 B = (0 * 14) + (-3 * 24) + (0 * 14) + (3 * 4) = -60 C = (-10 * 4) + (0 * 4) + (10 * 4) + (0 * 4) = 0 D = -(A * x[0] + B * y[0] + C * z[0]) = 120 ^ `--Note! This gives the plane equation: -60y + 120 = 0 or -y + 2 = 0 or y = 2 which is correct (not y=-2 as you wrote, actually there were several errors in your figures but the point order was the crucial bit). --Jonas -- ------------------------------------------------------------------------------ J o n a s Y n g v e s s o n Dept. of Electrical Engineering jonas-y@isy.liu.se University of Linkoping, Sweden ...!uunet!isy.liu.se!jonas-y