Jump to content


D3DXMATRIX help


7 replies to this topic

#1 Anddos

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 27 October 2008 - 02:32 PM

i have been looking at the documents for this and i cant seem to grasp the idea of D3DXMATRIX _1.1 , _1.2, etc , i know its saying column 1 row 1 , column 1 row 2 , but what does this mean on screen ?,
can someone help?

#2 starstutter

    Senior Member

  • Members
  • PipPipPipPip
  • 1039 posts

Posted 27 October 2008 - 04:17 PM

yes, you're right. ._11 would be the first row, first column. ._ 32 would be third row, second column. It looks confusing at first but its fairly straight forward.

As for what it means on screen? anything really. Totally depends on what the matrix is being used for. Are you talking about a camera matrix? A world matrix? The only time I've had to do much with the individual components of the matricies is when I use them to store colors to transfer into shaders. It's not extremley convienient but it only takes one call so I'm pretty sure its faster.
(\__/)
(='.'=)
This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!

#3 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 27 October 2008 - 04:19 PM

http://devmaster.net...rs_and_matrices
http://devmaster.net...rdinate_systems
http://devmaster.net...mation_matrices
reedbeta.com - developer blog, OpenGL demos, and other projects

#4 Anddos

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 28 October 2008 - 12:03 AM

yes but i mean whats the point in using them ? , i need to know what these floats mean in order to decide if i need to use them , if you get my drift

#5 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 28 October 2008 - 02:47 AM

If you're doing 3D graphics, you do need to use them. :)
reedbeta.com - developer blog, OpenGL demos, and other projects

#6 Anddos

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 28 October 2008 - 12:50 PM

yes but does each float have a meaning or do they have the same use

#7 Rofar

    Member

  • Members
  • PipPip
  • 99 posts

Posted 28 October 2008 - 04:03 PM

Typically, the floats stored in the matrix represent the Rotation, Scale, and Translation of an object in the game world.

#8 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 28 October 2008 - 04:19 PM

Most of the individual matrix elements do not have an easy to understand geometric meaning. However you can understand a matrix in terms of vectors. A matrix represents a geometric transformation, and can be thought of in terms of where it sends each axis (X, Y, and Z). If you look at each row of the matrix as a vector, then the first row is where the matrix sends the X axis. In other words if you put the vector [1, 0, 0] in, the first row is what you will get out. Similarly the second row is where it sends the Y axis, and the third is where it sends the Z axis. The fourth row is the translation.

Rofar is right in saying that the rotation, scaling, and translation are encoded in the matrix, but just to clarify, the rotation and scaling usually cannot be simply read off of the matrix elements. (The translation can, since as mentioned it's the fourth row.)

Read the articles I linked to for more info. If you are serious about 3D graphics a solid understanding of matrices and vectors is a must.
reedbeta.com - developer blog, OpenGL demos, and other projects





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users