Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

matrix multiplication order

Started by rewolfer Jul 19, 2009 at 11:35 AM 0 replies 3.2k views
Original Post
rewolfer
rewolfer
I want clarify that I understand things correctly. am i correct in saying that opengl does left-multiplication using column-major matrices when using the standard transform calls, glRotate, glTranslate etc. so if I wanted to scale(S) then rotate(R) then translate(T) a point P (row vector) (where S,R,T are row major) I would usually call

glTranslatef
glRotatef
glScalef
draw P
with the appropriate parameters. And taking R,S,T to be row-major, opengl's calculation looks something like T'R'S'P' which is equivalent to PSRT where ' denotes the transpose (swaps to column major). So if the current stack is given by W such that its effect on a point P is W.P' any new operation (row-major R) added to the stack, produces: WR'P' Am I correct in my thoughts? rewolfer edit: when i say equivalent, i mean value-wise - not orientation. the one produces a column vector, i know.

Topic Locked

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

Sign in to reply to this topic.