Revision as of 08:12, 5 January 2011

Draw3D comes with a user friendly, figure aware camera. It is a combination of cameras known from first person shooters (moving the camera) and other 3D libraries such as Java3D (orbiting). This document describes the cameras provided by Draw3D. If you need different functionality, see at the end of this document on how to implement your own camera or automated camera tracks.

Draw3D Preferences Dialog

You can configure what camera to use and the keys in the Draw3D preferences, as shown in Figure 1 and Figure 2.

Figure 1: Draw3D Preferences

Figure 2: Draw3D Camera Control Preferences

Actually, there are two cameras implemented which behave slightly differently. The default one behaves as described, while the so called "restricted" camera retains the "up vector" of the camera when orbiting around figures.

Developer Notes

You can easily create your own camera. Draw3D provides an interface org.eclipse.draw3d.camera.ICamera and an abstract implementation org.eclipse.draw3d.camera.AbstractCamera, however you can simply extend the both existing implementations org.eclipse.draw3d.camera.(Restricted)FirstPersonCamera. The camera has to be passed to the 3D lightweight system via org.eclipse.draw3d.LightweightSystem3D.setCamera(ICamera).

Although GEF3D/Draw3D does not provide any functionality for automated camera tracks yet, it is very easy to implement such functionality. You can use org.eclipse.gef3d.examples.graph.editor.performance.Camera360DegreeOrbit as a starting point. Also, you can use the animation classes provided by GEF/Draw2D, see org.eclipse.draw2d.Animation.

Feel free to contribute your own cameras! We would be happy to add them to the Draw3D camera collection :-)