Skip to main content
gamedev.net
🔒 Locked

about glMultMatrix()

Started by skywind 0 replies 1k views
Original Post
skywind
skywind
I have read a document: M is the current matrix and T is the matrix sent to glMultMatrix() after glMultMatrix() the current matrix is replaced with M*T but I was very puzzle in my programming and I think the result matrix is T*M but not M*T, for example: gluLookAt() is always used before every tranfers like glRotate() and glTranslate() that is said: if gluLookAt() got the CameraMatrix, an after gluLookAt(), glRotate() got a RotateMatrix then the result matrix must be RotateMatrix * CameraMatrix so I guess the result of glMultMatrix() is T*M not M*T but in many documents it is M*T, I was very puzzle so wrote the topic to find is some one can prove my idea is right help help,.....
Life is :-(Life is :-)
George2
George2
Directly from the red-book :

quote:

void glLoadMatrix{fd}(const TYPE *m);
Sets the sixteen values of the current matrix to those specified by m.void glMultMatrix{fd}(const TYPE *m);
Multiplies the matrix specified by the sixteen values pointed to by m by the current matrix and stores the result as the current matrix.

Note: All matrix multiplication with OpenGL occurs as follows: Suppose the current matrix is C and the matrix specified with glMultMatrix*() or any of the transformation commands is M. After multiplication, the final matrix is always CM. Since matrix multiplication isn''t generally commutative, the order makes a difference.

"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.