Movement of a camera

Started by
1 comment, last by Tyorl 21 years, 10 months ago
I know this is probably a really simple thing for most of you and you can do it without thinking but anyway. I have made a 3D engine in normal C++ and am converting it to Direct3d 8. I had some formulas for moving a camera forward using its original points (x,y,z) and an angle (call it angle a in radians) and moved by a radius (dist) and the formulas were as follows: x+=dist*cos(a) y=terrain.y + y (just to make it look like your walking on the terrain) z+=dist*sin(a) and these formulas worked very well. Now in Direct3D i used these formulas and they will not move the camera in the direction indecated by angle a. the camera will only move at angle 360 (or 0) no matter if you rotate the camera or not. So if anyone has suggestions on how to move the camera so that it is moved along a radius, I''m all ears.
Advertisement
you are using radiens correct? in any case, see the sdk for how things should be done. you are most likly not setting up the proper matrices or correctly dealing with how vertices are projected.

try using ransformed and lit vertices (D3DFVF_XYZRHW), if things dont work then its your code formula, else its how you are using d3d.

[edited by - a person on June 3, 2002 11:56:07 PM]
I guess what I am asking it what is the best way to move the camera horizontaly using an angle?

This topic is closed to new replies.

Advertisement