Jump to content
  • Advertisement

Archived

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

imDivineLight

Chase that camera or get chased yourself

This topic is 5165 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! I got my nice graphics core up and running with a range of nice functions. I also have a nice Camera class & a Skinned Mesh class, now i am looking forward to implement camera chasing routines. I move my character and i want that camera to stay behind him(Basically 3rd Person Cam). currently my player is placed infront of my camera. which is acheived by positioning the player on the camera''s position & adding the camera''s direction vector multiplied by a scalar value to character''s position. So whenever my cam moves my character also moves. So this is a character chasing camera, but how to do a camera chasing character. as far as i get, i think i have to add a direction vecter to my character also, which points in which direction my character will move, so then i have to place my camera at the characters position and add the characters dir vec multiplied by a negative scalar? Is it the nice way or there is some other advanced way? Please just make me literate

Share this post


Link to post
Share on other sites
Advertisement
umm... ya, just get your x and z values from the player''s direction vector, you''ll probably want to multiply it by something, and normalize the vector first...

As for your Y, just take your char''s Y plus a static value like 10.0f or 20.0f. You may also want to change your camera up value a bit so it looks at the character not at the horizon.

Share this post


Link to post
Share on other sites
Yeah, ok so i have to calculate and save direction vector in my chars or actors, it''s must i got it, and please tell me it has to be a unit vec or not, & if unit vec then what is the main reason of having a unit vec.

And yes i was having problem my camera was facing horizon, ok so i have to rotate it down on z vector, right!.

Thanks, just one problem with unit vecs, help solve it

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!