Orbit Camera
Andor Salga | 4 July, 2009 | 7:51
Here’s an interesting demo which makes use of an orbit camera.

I’m currently implementing an OrbitCamera for the library. An OrbitCamera is a camera which is restricted to orbiting about a single point. The OrbitCamera has pitch and yaw methods, but they pitch and yaw about the orbit point rather than its local axes. I decided to allow the flexibility to select any point to orbit around in the world rather than an object. If the object a camera is orbiting moves, the camera can simply be repositioned in the update callback. Methods to restrict how close or far the camera can move towards or away from the point have been added for convenience. Additionally, I created a Camera base class and now FreeCamera and OrbitCamera both inherit from that base class.
The OrbitCamera will be available for the 1.2 release.

I’m currently implementing an OrbitCamera for the library. An OrbitCamera is a camera which is restricted to orbiting about a single point. The OrbitCamera has pitch and yaw methods, but they pitch and yaw about the orbit point rather than its local axes. I decided to allow the flexibility to select any point to orbit around in the world rather than an object. If the object a camera is orbiting moves, the camera can simply be repositioned in the update callback. Methods to restrict how close or far the camera can move towards or away from the point have been added for convenience. Additionally, I created a Camera base class and now FreeCamera and OrbitCamera both inherit from that base class.
The OrbitCamera will be available for the 1.2 release.

Hello, I've tryied this code in the last Canvas3D library,
Maelvon | 2 October, 2009 | 10:38Hello, I’ve tryied this code in the last Canvas3D library, and in “orbitcamera.js” the zoom prototype doesn’t exist! I’ve only found yaw and pitch, is that normal ?
Maelvon
Hi Maelvon, To 'zoom' in and out you
Andor Salga | 3 October, 2009 | 8:25Hi Maelvon,
To ‘zoom’ in and out you should use goCloser() and goFarther() methods of the OrbitCamera. At one point I wanted to use just one function, zoom(), but thought it might be a bit vague. Does zoom with a positive value move closer or father away? There shouldn’t be any zoom() prototype in the library if you have the latest one. Make sure you get the latest from the Downloads page.
As I didn't find the zoom() proto, I'll copied the
Maelvon | 5 October, 2009 | 3:05As I didn’t find the zoom() proto, I’ll copied the zoom proto from this example in the last library, and it works. But, I should look at the goCloser() and goFurther() methods, as you say.
Thanks for the response, and for the great library.
Do you have an example of the use of goFurther() and goCloser() ?
Hi Maelvon, I don't think the demos posted
Andor Salga | 5 October, 2009 | 5:37Hi Maelvon,
I don’t think the demos posted use the OrbitCamera. But since you’re asking, I’ll post a demo of it’s use sometime this week.
Maelvon, I posted the new Orbit Camera demo which
Andor Salga | 12 October, 2009 | 14:11Maelvon,
I posted the new Orbit Camera demo which uses the 1.1 version of our library.
Cool, I've implemented it on my test page, it rocks! Thanks
Maelvon | 13 October, 2009 | 4:04Cool, I’ve implemented it on my test page, it rocks!
Thanks for the code.
I add an other question. If we’re in orbit camera mode, can we Pan the camera ?
When you want someone to pan, set a free camera's
Andor Salga | 13 October, 2009 | 16:00When you want someone to pan, set a free camera’s position to the orbit camera’s position. Then set the scene’s camera to the free camera and call whichever free camera function you need.