how it works

Understanding Papervision3D: Matrix3D

Monday, November 24th, 2008 | how it works | Comments

This post will cover how you use a Matrix3D to scale, pitch, yaw, roll, and translate 3d objects:

Every 3d object within Papervision3D has a Matrix3D that defines its scale, pitch, yaw, roll, x, y, and z (changing x, y, and z is referred to as “translation” because they move a group of points equally). You will find the Matrix3D in the “transform” property of your 3d object.

The default 4 column by 4 row Matrix 3d with no scale, yaw, pitch, roll, or translation is set up as follows:

1, 0, 0, 0
0, 1, 0, 0
0, 0, 1, 0
0, 0, 0, 1

These values are stored in the “transform” property of your 3d object using a “n”, a integer defining the row, and an integer for the column:

n11, n12, n13, n14
n21, n22, n23, n24
n31, n32, n33, n34
n41, n42, n43, n44

For example: cube.transform.n11

Scale, pitch, yaw, and roll are handled in the first 3 columns and rows of the matrix (play with the explorer above to figure out how it works):

1, 0, 0
0, 1, 0
0, 0, 1

x, y, and z are all handled first 3 numbers in the last column:

0
0
0

The last row hangs around to make Matrix multiplication possible. Have fun playing with the explorer to get a hang of how 3d objects are moved around. I hope to cover some of the Matrix3D math functions in the future.

Tags:

Search

Recommended Books

Speaking at FITC Toronto

Recent Comments

 

July 2010
M T W T F S S
« May    
 1234
567891011
12131415161718
19202122232425
262728293031  

Preferred Video Tutorial Resolution

  • 1024x768 (53%, 85 Votes)
  • 1280x1024 (15%, 24 Votes)
  • 1920x1080 (15%, 24 Votes)
  • 800x600 (13%, 20 Votes)
  • 480x320 (4%, 6 Votes)
  • 640x480 (0%, 2 Votes)

Total Voters: 160

Loading ... Loading ...