• ### What is your GameDev Story?

#### Archived

This topic is now archived and is closed to further replies.

# Need info on Modelview Matrix

This topic is 6178 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey there guys and gurus Being an overly inquisitive programmer, I need to know how the modelview matrix is laid out. I know that the matrix is 4X4 and I am sure that the first three rows contain the rotation, scaling, and camera position (?) and the last row is for transformations. Can anyone clarify this? Am I close? I am currently working on billboarding and I read that I could simply load an identity matrix (3X3) into the modelview matrix to achieve a ''cheaters'' billboarding effect. Any help would be great. -The Headstones are talking... Can you hear them?

##### Share on other sites
http://www.sjbaker.org/steve/omniv/matrices_can_be_your_friends.html

That should be everything you need to know.

Thx

##### Share on other sites
hi,
problem with the above mentioned tutorial is that it does not explain the contents.
it took me a while to collect the info.
basic setup (C-Style):
[ 0][ 1][ 2][ 3]
[ 4][ 5][ 6][ 7]
[ 8][ 9][10][11]
[12][13][14][15]

now the contents:
[ 0][ 4][ 8] = right vector
[ 1][ 5][ 9] = up vector
[ 2][ 6][10] = forward vector
[12][13][14] = Position
[ 3][ 7][11][15] = perspective projection

hope it helps.

cu

frank

##### Share on other sites
Ok... You are correct in that the afore mentioned page does not actually contain information on the layout of the modelview matrix. As a result I had to go collecting info as well, and I ended up with the same result-set. A few questions now, if you don't mind:

A) Are the RIGHT and UP vectors used to define the orientation of the local co-ordinate system and are these vectors relative to the axes (x and y) of said system?

B) Are these vectors normalized?

C) Is the FORWARD vector also referred to as the LOOKAT vector and is its purpose simply for defining the front and back of an object? (Does this parallel the z axis of a local coord sys?)

D) Does POSITION refer to the translation of the local origin relative to the world co-ordinates or to the camera?

E) (A dumb question I am sure) How is the perspective projection useful to me?

A lot of questions I know. Any help would be appreciated. Thx in advance.

I just thought of something else: Are the RIGHT and UP vectors perpendicular to each other? Are the FORWARD and UP vectors perpendicular to each other?

-The Headstones are talking... Can you hear them?

Edited by - orbis on February 17, 2002 2:06:04 AM

##### Share on other sites
Look in to the red book, in one of the last chapters theirs information about the modelview matrix(in one of the appendices).

##### Share on other sites
Thank you for your reply. However, the appendix that you refer to does not actually lay out the modelview matrix. The post from Frank was exactly what I was looking for.

-The Headstones are talking... Can you hear them?

##### Share on other sites
although I am also just learning the contents of the modelview matrix I''ll do my best.

A) Are the RIGHT and UP vectors used to define the orientation of the local co-ordinate system and are these vectors relative to the axes (x and y) of said system?

all vectors are coming from the position.

B) Are these vectors normalized?

don''t know

C) Is the FORWARD vector also referred to as the LOOKAT vector and is its purpose simply for defining the front and back of an object? (Does this parallel the z axis of a local coord sys?)

think so.

D) Does POSITION refer to the translation of the local origin relative to the world co-ordinates or to the camera?

the former iirc.

E) (A dumb question I am sure) How is the perspective projection useful to me?

i have no idea! ;-)

A lot of questions I know. Any help would be appreciated. Thx in advance.

I just thought of something else: Are the RIGHT and UP vectors perpendicular to each other? Are the FORWARD and UP vectors perpendicular to each other?

think of it this way.
picture yourself in space.
extend your right arm in a 90° angle to the right.
extend your left arm in a 90° angle forward.
the right vector is your right arm.
and your left arm is forward.
pos is your position in space.

hope i could help
i''f i find out more i''ll keep you posted.

cu

frank

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 9
• 9
• 15
• 14
• ### Forum Statistics

• Total Topics
634070
• Total Posts
3015335
×