Camera in D3D8

Started by
1 comment, last by ReiD 23 years, 3 months ago
Hi I got a question about the camera in Direct3D8 I''m using D3DXMatrixLookAtLH( camera pos, point to look at, up vector) Now on to the questions 1. What is the up vector, is it as simple as it sounds, a vector pointing to where the "sky" is? 2. I tried to implement quake like controls where you can move forward and turn around, strafe etc. Walking forward and strafing works ok (now), but the tricky part seems to be looking up/down and turning around. So the question would be, how do they do it, do they move the camera, move the world, rotate the camera, rotate the world?
Advertisement
your questions can best be answered with my camera code...check it out. it''s in the source for the landscape project I made. www.msu.edu/~furtwan1/projects.html near the bottom. the camera code is in camera.h and camera.cpp

rotating the camera, and the world are really the same thing. you really only need to use one matrix if you want, because they are all multiplyed together in the end. you could never use the view matrix, and just the projection, and world, or all three. the point is that nothing is special about the view/world matrix. SO if you want to have camera movement, you just rotate and translate everything in the opposite direction of the camera. usually you do this in the view matrix. Don''t use that D3DXLookAt funtion, or whatever it was.
Thanks for the quick answer, but the url for pseudo.zip and landscapesource.zip didnt work for me, only the program.zip

This topic is closed to new replies.

Advertisement