• Advertisement

Archived

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

Cameras Equations

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

How would you get a camera to rotate around an object thats not a 0,0,0 in your world. Thanks in advance. And i''ll be asking more things about cameras soon

Share this post


Link to post
Share on other sites
Advertisement
Make the look at vector for your camera the origin of the object you want to look at instead of 0,0,0? Store a rotation amount and increment it every frame then use trig to get a vector for a camera position that rotates around said point.

of course it would be easier if we knew what You are using? DirectX or OpenGL (or something else?).

Share this post


Link to post
Share on other sites
Oh sorry but it''s DirectX. When i made this post i was in a hurry and must have clicked on the rong section.

Share this post


Link to post
Share on other sites
Easy.
Vector3d NewView = View - Position;
// do whatever type of rotation you are doing. There are several
// methods you could use
View = NewView + Position;

Share this post


Link to post
Share on other sites

  • Advertisement