#### Archived

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

# object & camera

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

## Recommended Posts

hi all, i am new here, have a project to accomplish.. i have written a camera and a player class where each generate camera and player.. i want my camera to follow the man where i cannot yet move the man in the direction he looks.. more precisely: i want to move the man where ever he is facing.. i can move him in x or other directions but cannot move him where he faces.. i can move the camera around but cannot make it follow the man.. what shall i do in order to make these work? tnx

##### Share on other sites
The moving part is pretty straight forward. Store a vector that points in the direction the man is initially facing. When you rotate the man, rotate the "direction" vector by the same amount. When you want to move the man, move him along the "direction" vector.

##### Share on other sites
well the man is facing [0.0,0.0,-1.0] i mean to -z direction..
how can i show this as a vector?
i am quite not familier with these vectors..
how can i learn how to use vectors? do you know some tutorial or very simple sample code for me to look and see?
thank you by the way.. it was a quick answer..

##### Share on other sites
this is my favorite 3D math quick reference page:
http://www.geocities.com/SiliconValley/2151/math3d.html

for more in depth tutorials on 3D math (Linear Algebra) look in the Articles & Resources section of this site under the Math section. and just FYI, [0,0,-1,0] _is_ a vector. a vector is just a direction in 3-space. but read the tutorials and it will make more sense.

-me

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 28
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631772
• Total Posts
3002260
×