anybody know their math? 
Mr_Stabby 
i've run into a bit of a snag given that my 6th grade math skills don't seem to be cutting it anymore
im trying to define a plane, i managed to do it by defining 3 points on the plane like this p1, p2, p3 are the points tan1 = (p2.yp1.y)/(p2.xp1.x) tan2 = (p3.yp1.y)/(p3.xp1.x) tanp1 = (p2.zp1.z) / distance between p1 and p2 tanp2 = (p3.zp1.z) / distance between p1 and p3
after that i can give the plane xy points and it can calculate the Z like this pivotZ + tanp1 * sqrt(pow(x, 2) + pow( tan1 * x, 2))  ( tan1 * x  y) * ( tanp1 * sqrt(pow(x, 2) + pow(tan1*x, 2)) tanp2 * sqrt(pow(x, 2) + pow(tan2 * x, 2))) / (tan1 * x  tan2*x) (if x is 0 can swap x and y and tan1, 2 = 1/tan 1, 2)
then i realized that that must be the clunkiest implementation of a plane.. ever :p afaik you should only need Z, xAngle and yAngle to define any plane and made a constructor/z calculator based on that. now i have these 2 definitions of a plane but i want to be able to cross from one to another but im having a real hard time figuring it out since i think im out of linear math depth so basically..
how do you go from p1, p2, p3 to Z, normal vector? i tried google and wikipedia but meh its full of all kinds of weird signs and doesnt make any sense to me :/
read 866 times 10/9/2011 5:22:14 AM (last edit: 10/9/2011 5:22:14 AM)

nm8r 
read 852 times 10/9/2011 8:00:20 AM (last edit: 10/9/2011 8:04:43 AM)

Garp 
You want to search for cross product.
In a coconutshell, if you have three points A(Ax,Ay,Az), B(Bx,By,Bz) and C(Cx,Cy,Cz), the normal vector V(Vx,Vy,Vz) is such that: Vx = (ByAy)(CzAz)  (BzAz)(CyAy) Vy = (BzAz)(CxAx)  (BxAx)(CzAz) Vz = (BxAx)(CyAy)  (ByAy)(CxAx) So V is perpendicular to (ABC), pointing towards you if you see ABC in CCW order (righthand rule) and with a length that's twice the surface of the triangle ABC.
read 843 times 10/9/2011 8:18:39 AM (last edit: 10/9/2011 8:19:30 AM)

advancesoftware 
you usually define a plane using the normal to the plane & the distance from the origin along that normal to the intersection of the plane.
P=(N,d)  so that's 4 floats.
read 835 times 10/9/2011 8:53:18 AM (last edit: 10/9/2011 9:03:12 AM)

Garp 
quote: how do you go from p1, p2, p3 to Z, normal vector?
read 833 times 10/9/2011 8:56:47 AM (last edit: 10/9/2011 8:56:47 AM)

advancesoftware 
hang on. not enough caffeine yet.
plane normal using cross product as you said.
haven't checked this is correct, but it's something like this :
http://paulbourke.net/geometry/planeeq/
read 827 times 10/9/2011 9:02:55 AM (last edit: 10/9/2011 9:05:47 AM)

digital3ds 
thats some 6th grade class
 Mike Sawicki
read 821 times 10/9/2011 9:05:24 AM (last edit: 10/9/2011 9:05:24 AM)

Garp 
Hang on too. I'm having tea.
Could be that Stabby's points are not defined by cartesian coordinates (?).
@digital3ds: I know. That's feckin old!
read 818 times 10/9/2011 9:07:28 AM (last edit: 10/9/2011 9:08:27 AM)

advancesoftware 
if they're not he can convert them. tea #3. need to get to around 10 before I start doing anything remotely useful.
read 811 times 10/9/2011 9:11:54 AM (last edit: 10/9/2011 9:13:14 AM)

advancesoftware 
here you go :
http://tog.acm.org/resources/GraphicsGems/gemsiii/newell.c
read 806 times 10/9/2011 9:15:50 AM (last edit: 10/9/2011 9:15:58 AM)

Garp 
That's exactly what I posted! Except I used vectors AB and AC intead of u and v.
read 801 times 10/9/2011 9:21:06 AM (last edit: 10/9/2011 9:21:23 AM)

advancesoftware 
well then either they're both wrong in exactly the same way or he has what he needs.
can I get back to breakfast now ?
:)
read 798 times 10/9/2011 9:22:03 AM (last edit: 10/9/2011 9:29:44 AM)

Mr_Stabby 
thanks guys, i think thats what i need all though my initial implementation resulted in disaster but its too late here anyway try again tomorrow!
read 772 times 10/9/2011 10:29:54 AM (last edit: 10/9/2011 10:29:54 AM)

gogodr 
Let p1=(x1, y1, z1), p2=(x2, y2, z2), and p3=(x3, y3, z3) be noncolinear points.
(Xx1)(Yy2)(Zz3)+(Yy1)(Zz2)(Xx3)+(Zz1)(Yy2)(Yy3)(Zz1)(Yy2)(Xx3)(Yy1)(Xx2)(Zz3)(Xx1)(Zz2)(Yy3)=0
this should do it.
how did I came up with the formula?
this is a method to use this determinant and get all the points that makes the plane
xx1 yy1 zz1 xx2 yy2 zz2 = 0 xx3 yy3 zz3
:: random pony heavy gif alert ::
Hello therebeautiful ;3
read 755 times 10/9/2011 12:12:25 PM (last edit: 10/9/2011 12:36:06 PM)

9krausec 
that's called a matrix, right gogodr? Been a while since I dinked with math.
 Portfolio
read 699 times 10/9/2011 11:38:35 PM (last edit: 10/9/2011 11:38:35 PM)
