Hi,
I have to find the vector "pv" perpendicular to an arbitrary vector
"tv".
The perpendicular vector "pv" has to be parallel to the XZ (floor)
plane.
How to do it?
I have successfully found a generic perpendicular with the cross
product
between tv and a random vector rv. Of course the result is a vector
not
always laying on the XZ plane so pv[1] != 0.
So I have found this trick. Firstly I set rv = tv. Then I set rv[1]
= 0 or
rv[1] += 12345; So tv and pv lay on the same vertical plane.
So I find pv[1], that is pv is parallel to the plane XZ. Good.
The problem is that this trick doesn't work for any tv. E.g. when
tv is
{0, 1, 0} it doesn't work.
Best Regards
--
Lorenzo
email: email@hidden
You can compute a vector pv, which is perpendicular to a vector tv
and parallel to the x-z-plane in this way:
Being parallel to the x-z-plane is equivalent to being perpendicular
to the y-axis, or to the vector (0, 1, 0) respectively.
Computing the cross product of tv and (0, 1, 0) results in a vector
being perpendicular to tv and (0, 1, 0), and therefor parallel to the
x-z-plane too.
From your post I assume, that you know how to compute the cross
product.
Cheers
Klaus
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden