Archived

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

Movement of a camera

This topic is 5674 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 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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites