Jump to content
  • Advertisement

Archived

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

Fuzztrek

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!