I've been playing around with computer graphics after taking a course on it at uni. What I want to do is move a "camera" around an arbitary point ("origin") by a known distance... the method taught for this kind of thing was rotating the entire scene and leave the camera unchanged, but that's horribly inefficient for a scene with a high poly count...
The way I've been thinking to do this is to move the camera along an imaginary circle, always pointing at the origin. My attempts to figure this out myself have been pretty bad
So say the origin is at (0,0,0) (x,y,z) and the camera is (10, 10, 0). The y value will be constant (since it's the "up" axis) with new values for x and z simulating movement. I want the camera to move by, say, 5 degrees.
I can figure out where on the circle the camera has moved to (by finding the length of the arc), but how can I translate this back into 3d coordinates (with full 360 rotation)?
erm, nevermind. the horrible performance I was talking about was due to a couple of problems with my algorithm and the method of refreshing the scene. rotating the entire scene is just fine.
Hi robjohns, and welcome to the forum.
That's the second time this week someone has solved their own problem ... must be the big build up of karma happening here.
"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman
"the method taught for this kind of thing was rotating the entire scene and leave the camera unchanged, but that's horribly inefficient for a scene with a high poly count..."
HAH! Thats exactly what I did with my 3d engine. I thought it was a some what primitive and ineligant method but it seems to work. Also I'm sure the 3d rotation only effects what I call the virtual coordinates, (temporary copies of the real coordinates that are translated) so the objects real coordinates are unchanged so the world does not revolve around you!
Last edited by mikau (2005-11-08 08:59:15)
A logarithm is just a misspelled algorithm.