Jump to content
  • Advertisement

Archived

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

tiwummbihaou

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.

If you intended to correct an error in the post then please contact us.

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 this post


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


Link to post
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 this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!