Canvas 3d JS Library

WebGL made easy!
  • rss
  • What is C3DL?
  • Download
  • Tutorials
    • Tutorial #1: WebGL Browsers
    • Tutorial #2: A simple scene
    • Tutorial #3: Callback
    • Tutorial #4: Models
    • Tutorial #5: Light effects
    • Tutorial #6: Picking
  • Development News
  • Documentation
  • Community
  • Resources
  • Contact
  • About

Orbit Camera

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

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.
Categories
c3dl development
Comments rss
Comments rss
Trackback
Trackback

« Template Creation User Defined Shaders »

7 responses

Hello, I've tryied this code in the last Canvas3D library,

Maelvon | 2 October, 2009 | 10:38

Hello, 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:25

Hi 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:05

As 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:37

Hi 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:11

Maelvon,
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:04

Cool, 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:00

When 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.

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Videos

Demos

  • Asteroids-3D
  • Particle Systems Demo
  • Cross-Browser Orbiter
  • Mocap Demo With Spheres
  • Google Maps-3D

C3DL Development News

C3DL 2.0-WebGL and beyond

It has been a long time coming but we have now updated all the core features of C3DL to use WebGL. You can dowload our 2.0 release here. We have also updated all our demos to use WebGL. Our tutorials have all been updated (tutorial 5 and 6 needs a better example [...]

Preliminary WebGL RTS Game

Cathy asked me to make a cool demo using our library. After thinking about, I started getting many ideas, but creating a preliminary real-time strategy game made the most sense. It not only demonstrates a lot of C3DL features such as model loading, transformations, lighting, shaders, picking, cameras, textures, etc, but since animation is kept [...]

Tutorials

  • Tutorial #1: WebGL Browsers
  • Tutorial #2: A simple scene
  • Tutorial #3: Callback
  • Tutorial #4: Models
  • Tutorial #5: Light effects
  • Tutorial #6: Picking

Documentation

Archives

Archives

C3DL Development News

Recent Comments

  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • C3DL 2.0-WebGL and beyond
  • Preliminary WebGL RTS Game
  • Asteroids in 3D… and a bit of 2D
  • Another demo updated
  • Simplifying the Interface
  • Updating Demos
  • Cross-browser progress update
  • let there be vars
  • Creating tester pages
  • Problems with porting
  • keep it coming ve... - gero3
  • congrats on a great... - Paul Brunt
  • c++ not c# actually... - Cathy Leung
  • It's unbelievable ho... - Paul
  • Wow, now that's a co... - Andor Salga
  • Hi, is the project... - Sascha Hendel
  • I agree with both co... - Cathy Leung
  • Your library is real... - Sascha Hendel
  • Hi, as a more gener... - Sascha Hendel
  • Thanks. I just pull... - peter



Canvas 3d JS Library

©2007- 2009 Canvas 3d JS Library

Disclaimer: This website is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Canada License.
The Canvas 3d JS Library and Demos found on this website are licenced under the MIT License

Creative Commons License