Cameras Equations
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
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?).
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;
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
Popular Topics
Advertisement