Skip to main content
gamedev.net
🔒 Locked

Very Quick question.

Started by BornToCode Aug 26, 2006 at 8:50 PM 1 replies 650+ views
Original Post
BornToCode
BornToCode
I was wondering if i am correct. The camera is considered to be the inverse of the world matrix. So which means that in that case i can set my transformation as if i am doing a wolrd transformation and just inverse that when i am done, and i should get the same result as the world but this time with the camera right. Also another question i have is that in DirectX, since we are dealing with left hand coordinate, and it is row dependent when it comes to the way that the matrix is layed out. Now let's say i wanted to extract the x axis would it be the element _11 _12 _13 _14 or the column _11 _21 _31 _41.
deathkrush
deathkrush
Quote:
Original post by BornToCode
I was wondering if i am correct. The camera is considered to be the inverse of the world matrix. So which means that in that case i can set my transformation as if i am doing a wolrd transformation and just inverse that when i am done, and i should get the same result as the world but this time with the camera right.


Yes, inverting the world transform would give you the view matrix. You can avoid the inverse if you do something like this:

For example, if this is a world transform:
Translate(x, y, z) * Rotate(theta, x, y, z) * Scale(x, y, z)

an equivalent camera transform would be:
Scale(1/x, 1/y, 1/z) * Rotate(-theta, x, y, z) * Translate(-x, -y, -z)

Quote:
Original post by BornToCode
Also another question i have is that in DirectX, since we are dealing with left hand coordinate, and it is row dependent when it comes to the way that the matrix is layed out. Now let's say i wanted to extract the x axis would it be the element _11 _12 _13 _14 or the column _11 _21 _31 _41.


DirectX and OpenGL both store row vectors in memory. Right handed vs left handed doesn't apply here (it only applies to projection transforms). The X axis would be the row _11, _12, _13, _14.
deathkrushPS3/Xbox360 Graphics Programmer, Mass Media.Completed Projects: Stuntman Ignition (PS3), Saints Row 2 (PS3), Darksiders(PS3, 360)

Topic Locked

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

Sign in to reply to this topic.