Skip navigation

If you have 3 vectors, right, up, and forward, you can write a ROW MAJOR change of basis matrix as follows:

  [       right.x     right.y     right.z   ]
  [          up.x        up.y        up.z   ]
  [    -forward.x  -forward.y  -forward.z   ]

The new basis in terms of the original basis are the ROWS of this change-of-basis matrix.

This matrix takes any vector with (1,0,0), (0,1,0), (0,0,1) as its OLD basis vectors, and rotates it so that its new basis vectors ARE right,up,forward as given.

A viewing matrix is the transpose of the change of basis matrix, because a viewing matrix “pushes the world away” from a stationary camera. (The viewing matrix isn’t going to _move the camera_, instead it moves the whole world so that the portion you want to see sits in the canonical viewing volume).

To make this column major

Just transpose it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: