Path: chuka.playstation.co.uk!news From: "Peter Dollochan" Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: Quirky Maths Prob Date: 22 Jan 1998 23:10:25 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 45 Message-ID: <01bd278b$91620720$683063c3@default> References: <01bd2751$acaa0620$cc3163c3@default> <6a8935$722@chuka.playstation.co.uk> NNTP-Posting-Host: host5-99-48-104.btinternet.com X-Newsreader: Microsoft Internet News 4.70.1161 By god man I think you've cracked it, however I just spent the time between post's limiting the heightfield landscape to 30 & 60 deg angles.But I'll be sure to include this gem in the next version. Thank for your help Pete. Graeme Evans wrote in article <6a8935$722@chuka.playstation.co.uk>... > I think this is a simultaneous equations problem > > What you want to find is the equation of the plane > > Z=aX+bY+c > > then rearrange it in the form Y=(Z-aX-c)/b > > All you need to find are the variables a, b and c. > > You have three equations > > z1 = ax1 + by1 + c > z2 = ax2 + by2 + c > z3 = ax3 + by3 + c > > So you have enough pairs of simultaneous equations to solve for a, b and c > > And the answer is; > > b = -(-z2*x3+z2*x1+x2*z3-x2*z1+z1*x3-x1*z3)/ > (-x2*y3+x2*y1+y2*x3-y2*x1+x1*y3-y1*x3) > > a = (z3*y2-z3*y1-y3*z2+y3*z1-z1*y2+y1*z2)/ > (-x2*y3+x2*y1+y2*x3-y2*x1+x1*y3-y1*x3) > > c = (-y3*x2*z1+z1*y2*x3-z3*y2*x1+y3*z2*x1-y1*z2*x3+z3*x2*y1)/ > (-x2*y3+x2*y1+y2*x3-y2*x1+x1*y3-y1*x3) > > heh heh > > Graeme > > >