Cameras Equations

Started by
2 comments, last by CppDave 21 years, 2 months ago
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
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?).
Oh sorry but it''s DirectX. When i made this post i was in a hurry and must have clicked on the rong section.
Easy.
Vector3d NewView = View - Position;
// do whatever type of rotation you are doing. There are several
// methods you could use
View = NewView + Position;

This topic is closed to new replies.

Advertisement