How to make normal rotate?
by DieRich · in Torque 3D Beginner · 03/11/2011 (6:43 am) · 4 replies
hi all, I'm confusing about how to make a MatrixF object whose up-vector is VectorF(0, 0, 1) rotate to up-vector VectorF(0, 1, 0). I don't know how to get the rotation MatrixF to do this. any help will be very thankful.
#2
The Up direction becomes the forward one.
The Forward direction becomes the negative up one.
You have to swap only unit vectors.
1.It works a lot faster.
2.You don't need a temporary storage.
3.You're not losing precision.
4.You don't have to worry about the matrix concatenation.
03/12/2011 (4:26 am)
In addition to this information,when you rotate with M_PI/2 rotations it is better to set columns directly into your current transform.The Up direction becomes the forward one.
The Forward direction becomes the negative up one.
You have to swap only unit vectors.
1.It works a lot faster.
2.You don't need a temporary storage.
3.You're not losing precision.
4.You don't have to worry about the matrix concatenation.
#3
03/12/2011 (6:47 am)
It works thanks all of you.
#4
03/12/2011 (5:52 pm)
Good stuff I never knew I did not know.
Torque Owner Ryan Mounts
CornerstoneViz
right = (1, 0, 0)
left = (0, 0, -1)
up = (0, 1, 0)
then you can simply set the tranformation matrix directly...
If you want something more general, for example, that rotates an object -90 degrees about the x-axis and doesn't care about the other axes...
Hope that is helpful/understandable.