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


orbit camera

Recommended Posts

The standard way of doing cameras is to use three vectors: View, Position, and up. When the camera is to be rotated, the position - view gives you the vector from the origin, and you rotate at that point, and then translate back out.

There is more than one way of rotating the point.

Euler Angles - Suck. I can never get my camera to work properly when it is facing down any axis at either 90 or 360 degrees. I can''t seem to find a way to fix it either, without making the camera entirley screwy at said points. I don''t recommend this method. Even if your camera works, it''ll be jerky and annoying.

Axis-Angles - Work great, easy to understand and derive. I use this approach normally.

Quaternions - A little more difficult to understand, but still not all that hard to implement. I recommend being fairly proficient in linear algebra before delving into quaternions, as this will make the subject more palettable.

Cylindrical Coordinates - People mistakenly call this method polar or spherical when they''re in 3d (don''t use spherical, because it is a pain in the ass to calculate z-coordinate with trig functions). It worked ok, exept that the atan function would return 0 sometimes, and I would get a divide by 0, so my camera acted identical to the euler angle camera at 90 and 360 degrees. I don''t recommend this method either.

If you want, I can give you some resources related to any of these three methods. I wrote a paper that was a recently a featured article explaining the construction of a simple first-person quaternion camera that is a good place to start.

Share this post

Link to post
Share on other sites
Thanks for the fast reply
I have no problem with quaternions and I have the required math
I have done an orbitting effect but the whole world is orbitting around the pivot point and the camera is stationary, I need the world to be fixed in the middle of the screen while the camera is orbiting around the pivot, may be what is happening with me is the right thing but I dout it
I would appreciate it if u send me the resources u r talking about.



Share this post

Link to post
Share on other sites