#### Archived

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

# matricies... o_o

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

## Recommended Posts

lo!! me again. just wondering if anyone could help explain matricies to me. not the math of matricies.. but, the world, view and projection matricies, and how they are used. I was under the impression that you could only have one world matrix, but i feel as though i was wrong. could someone tell me the different uses of matricies and such? thanks in advance!!! -Fuzztrek ¬_¬

##### Share on other sites
Okay, let me try and explain those 3 matrices.. If i get anything wrong, please done hesitate to correct me.

First, there''s the projection matrix. This matrix defines how your 3d scene is mapped onto the screen. There are two main functions you''ll use to initialize your projection matrix. D3DXMatrixPerspectiveFovLH() for setting up a matrix used for rendering 3d objects. And D3DXMatrixOrthoLH() for setting up the matrix to dispaly 2d objects (typically used for user interface objects or complete 2D games made with Direct3D8)

Second, you got the view matrix. This simply defines where the camera is in 3D space. You will typically use the D3DXMatrixLookAtLH() function to initialize the view matrix. You simply plug in the location of the camera, where you want the camera to look, and which direction is UP in the world you''ve created.

Finally, you got the world matrix. This matrix is used for keeping track of the next object to be rendered. If you want to create a triangle at (x, y, z), you would use D3DXMatrixTranslation() to setup the translation (offset) matrix. And then when creating the triangle, it would be made at the current location of the world matrix.

Please keep in mind that all these functions will simply generate a matrix. You must then APPLY that matrix to your device by calling device->SetTransform() with the appropriate matrix you want to set (projection, view, world).

Hope this helps.

Brett

##### Share on other sites
wow. seems complicated, but it was very helpful! thanks a lot!

¬_¬

1. 1
2. 2
3. 3
Rutin
22
4. 4
JoeJ
16
5. 5

• 14
• 29
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631774
• Total Posts
3002288
×