Jump to content
  • Advertisement

Archived

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

benliong

How to do Camera Angle like Tomb raider

This topic is 6117 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

Without taking Collision detection for the camera into account, how do you have the camera behind the character? Say you have the position vector for the character, and a unit vector of direction he''s facing. Would you recommand using gluLookAt() or just plain glTranslate() / glRotate()? One more thing, when I use gluLookAt(), the diffused like looks fine, but when I just use glTranslate / glRotate without gluLookAt, there seem to be only ambient light. Can someone tell me why that''s happening? Thanks in advanced....

Share this post


Link to post
Share on other sites
Advertisement
Hmm....

Transform the angles to a Vector describing how the character is facing(using sin and cos...you can surely figure out a formula yourself(i did)):

(facing is normalized)

camera = character_origin - facing * cameradistance;
cameradir = character_dir

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!