Jump to content
  • Advertisement


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


Camera matrix

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

Hi I have a beginner question. When I build my camera model, I create the controls to increment a variable during the virtual key codes for a LookatCamera i.e case VK_UP: xPos += 3.0f; case VK_RIGHT: yRot += 3.0f; SetViewMatix(matrix,from,at,up) 3dDevice->SetTransform(VIEW,matrix) Using this technique the camera is real jerky. But if I were to have a matrix that saves the movement then concatenate that matrix with an increment then it''s nice and smooth. i.e. WM_KEYDOWN: { case VK_UP: xPos = 3.0f; case VK_RIGHT: yRot = 3.0f; } WM_KEYUP { case VK_UP: xPos = 0.0f; case VK_RIGHT: yRot = 0.0f; } SetIdentity(matView) SetViewMatix(matView, at, from,look) matrixmultiply(matrix,matView,matrix) 3dDevice->SetTransform(VIEW,matrix) The only problem I have with this is that when I pitch up or down then yaw left or right it seems the whole axis is screwed up where it yaws in a U type angle instead of perfectly around my scene. The camera movement for the first example is good (I increment the variable''s then create the entire matrix) but it''s real jerky if anyone has any ideas I would greatly appreciate it. If what I write is confusing to anyone, all I''m looking for is to have something that works like a "Deus Ex" camera.

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!