Jump to content
  • Advertisement

Archived

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

Wicked Ewok

How do you extract a View Camera Position relative to the World

This topic is 5887 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

I need to extract the current camera position. Below is how I transform the View Matrix so that I can mouse look, zoom, strafe, etc. //I set up my camera once with an up vector: D3DXMatrixLookAtLH(&matView, &gCameraPosition, &gLookAtPosition, &D3DXVECTOR3(0.0f, 1.0f, 0.0f)); //Now for mouse look I multiply the current matrix(matView) by a rotation matrix //that has the rotational angles already D3DXMatrixMultiply(&matView, &matView, &matRotate); pd3dDevice->SetTransform(D3DTS_VIEW, &matView); //for movement, I multiply the current View matrix by a transform matrix and set it: D3DXMatrixMultiply(&matView, &matView, &matTransform); pd3dDevice->SetTransform(D3DTS_VIEW, &matView); Ok, now all I have is the static matView that is updated everytime, then set as the View matrix. How do I extract a 3D position from that matrix? Can I? Simple question I think, still clueless though. Thanks! -=~''''^''''~=-.,_Wicked_,.-=~''''^''''~=-

Share this post


Link to post
Share on other sites
Advertisement

  • 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!