Matrix

Discussion about everything. New games, 3d math, development tips...
Post Reply
ttom
Posts: 43
Joined: Tue Aug 26, 2003 3:43 am
Location: Taiwan

Matrix

Post by ttom »

Hi dear folk:
I read the so book about the opengl or direct3d , they just talk about the
matrix. I found something strange.
Below is the matirx

Transformations

some book write this some book write this
| 1 0 0 0 | | 1 0 0 tx |
| 0 1 0 0 | | 0 1 0 ty |
| 0 0 0 1 | | 0 0 1 tz |
| tx ty tz 1 | | 0 0 0 1 |


My question is what different between they?
ps. sorry for my poor english.
BradB
Posts: 17
Joined: Wed Feb 11, 2004 11:44 pm
Location: New Zealand

Post by BradB »

One is the transpose of the other. I am not 100% sure, but I believe that OpenGL and directX use opposite conventions for row/column order.
I think the left matrix is OpenGL's style, and the right DX style.

You can move between the two by using rows as columns and columns as rows.

Brad
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

yeah that's right... for some reason a matrix representation in OpenGL is symmetric to the standard representation in DirectX and mathematics. So in DirectX (standard) Mij = OpenGL Mji. If you have the OpenGL Programming Guide (the red book) read page 106.
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

I almost forgot, you are wrong about the order. The left matrix that ttom wrote is the standard matrix form that DirectX also uses. The right matrix is the transpose of the the standard which OpenGL uses.
James

Post by James »

And don't forget that every math textbook that cares about its reputation uses the right matrix format :)
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

Really? One of my degrees is in mathematics and I've never used the matrix form on the right in school or in any of my textbooks. That's why I was calling the matrix on the left "standard".
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

He was most likely meaning the "correct" one, but idk
The Robomaniac
Project Head / Lead Programmer
Centaur Force
Post Reply