#97580 - Rajveer - Thu Aug 10, 2006 4:46 pm
hi, im trying to rotate a 3d object by an arbitrary axis. i have stored the object's local axis as a 3x3 matrix starting off as the identity matrix, and pressing left/right will rotate the object on the y-vector (second column) in the matrix.
1 0 0
0 1 0
0 0 1
x y z (axis)
to modify the local axis when rotating, i thought i could multiply the rotation matrix created, by the 3x3 matrix. the reason why was because multiplying the rotation matrix by vertices at coordinates (1, 0, 0), (0, 1, 0) and (0, 0, 1) would rotate them correctly so it should do the same with these position vectors. to do this i store the rotation matrix in a temporary 3x3 matrix, call glLoad.. to load the axis and call glMult.. to multiply it by the rotation matrix.
my questions:
1) how would i now store these results in the original 3x3 axis matrix?
2) is this way of modifying axis ok? any tips?
cheers
1 0 0
0 1 0
0 0 1
x y z (axis)
to modify the local axis when rotating, i thought i could multiply the rotation matrix created, by the 3x3 matrix. the reason why was because multiplying the rotation matrix by vertices at coordinates (1, 0, 0), (0, 1, 0) and (0, 0, 1) would rotate them correctly so it should do the same with these position vectors. to do this i store the rotation matrix in a temporary 3x3 matrix, call glLoad.. to load the axis and call glMult.. to multiply it by the rotation matrix.
my questions:
1) how would i now store these results in the original 3x3 axis matrix?
2) is this way of modifying axis ok? any tips?
cheers