#### Archived

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

# Movement of a camera

This topic is 5979 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 on other sites
I guess what I am asking it what is the best way to move the camera horizontaly using an angle?

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5

• 12
• 19
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
632929
• Total Posts
3009286
• ### Who's Online (See full list)

There are no registered users currently online

×