View Full Version : Get the geometric transformations of an object
sergi
06-03-2002, 11:37 PM
Hi,
I don't get to grab the geometric transformations of an object in a matrix.
I build the matrix M as follows:
M =
TranslationMatrix(pivotPointVector) *
RotationMatrix(rotationAngle.x, 'x') *
RotationMatrix(rotationAngle.y, 'y') *
RotationMatrix(rotationAngle.z, 'z') *
TranslationMatrix(-pivotPointVector) *
Questions:
- The rotationAngles have their values in angles instead radians. Is it correct?
- Is the matrix product in the correct order ?
- Thanks
1: In OpenGL, tha angle is measured in degrees. Your function is not OpenGL's fuctions, so can't say whether they use radians or degrees, or anything else.
2: Correct order for what? You didn't say what you want, so can't say if it's correct. Judging by the name of the variables used, I assume you are trying to rotate about a specific point other than the origin. Still, I can't say if it's correct, cause you haven't described the functions. Order of multiplication for example; this is important to know, since A*B is not equal to B*A in the world of matrices.
CopyCat
06-04-2002, 01:28 AM
Use quaternions instead of matrices for rotation... mutliplying two quaternions is faster then multiplying a matrix.
You can do SLERP with them etc http://www.opengl.org/discussion_boards/ubb/smile.gif
Originally posted by CopyCat:
Use quaternions instead of matrices for rotation... mutliplying two quaternions is faster then multiplying a matrix.
You can do SLERP with them etc http://www.opengl.org/discussion_boards/ubb/smile.gif
Quaternions are such overkill, same thing
can accomplished with regular matrix maths. and yes, you can Slerp with them to:
http://www.gamedev.net/reference/articles/article1199.asp
Jambolo
06-04-2002, 09:35 PM
Originally posted by Informative:
http://www.gamedev.net/reference/articles/article1199.asp
I wish people would stop quoting this article. It's flawed and misguided.
Gavin
06-05-2002, 05:57 AM
Quaternians are definately not overkill. The notion that they are longwinded is just bizarre. There do have their uses, in fact we need them quite alot for solving rotation based problems using maths. But just for keeping track of a objects rotation in a game or something it is neither here nor there which format you use.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.