PDA

Click to See Complete Forum and Search --> : Vectors and Planes (as always)


Zaei
Jun 11th, 2001, 09:24 AM
Ok, just for setup. Working in 3D space, with the Y axis defining Up, I have a plane, defined by 3 random points. I also have a vector tht runs along the XZ plane (flat). How would I find the vector that would follow the first plane in the direction defined by the vector on the XZ Plane? Thanks much.

Z.

kedaman
Jun 11th, 2001, 04:25 PM
scalar product

kedaman
Jun 11th, 2001, 04:35 PM
i'm sorry i got a bit confused with your explanation. The X and Y components should inherit the vector in Z=0, Z can be evaluated by the plane equation if you set it's X and Y components to the X and Y components of the vector in Z=0.

Zaei
Jun 12th, 2001, 07:17 PM
Thanks kedaman. Its working pretty well, except the value I come out with is always negative. Im doing it like this:

Vel.y = (-pln.d - (pln.a*Pos.x) - (pln.c*Pos.z)) / pln.b;


Otherwise, It works like a charm. Know what's wrong?

Z.

kedaman
Jun 13th, 2001, 10:52 AM
I don't know what your a, b and c's are, but i suspect you've missed something in the equation

Zaei
Jun 14th, 2001, 01:25 PM
Yeah, I figured it out last night. The equation should be:

Vel.y = ((-pln.d - (pln.a*(Pos.x+Vel.x)) - (pln.c*(Pos.z+Vel.z))) / pln.b) - Pos.y;


Thanks for the help =).

Z.