Archived

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

wh0mk

Camera matrix

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