The SandyCamera is an interactive demoprogram by Clas Le Petit, It is written i Actionscript 2.0, to demonstrate the basic movements of a Camera3D. It uses Sandy, the 3D Actionscript library for Flash by Thomas Pfeiffer.
This is the camera view of the Sandy world. The ViewFinder has a crosshair, that can be turned on or off, using the check box in the lower right corner.
With the CameraControl in the right pane you control basic movements of the camera within the world.
Tilt - tilt( angle ) - Rotation around the camera x axis by angle - 0 to 360 degrees. Roll - roll( angle ) - Rotation around the camera z axis by angle - -180 to 180 degrees. Pan - pan ( angle ) - Rotation around the camera y axis by angle - 0 to 360 degrees. Upwards - moveUpwards( distance ) Translation along the camera y axis by distance. Sideways - moveSideways( distance ) Translation along the camera x axis by distance. Forward - moveForward( distance ) Translation along the camera z axis by distance.
RotX - rotateX( angle ) - Rotation around an axis through the camera and parallel to the global x axis. RotY - rotateY( angle ) - Rotation around an axis through the camera and parallel to the global y axis. RotZ - rotateZ( angle ) - Rotation around an axis through the camera and parallel to the global z axis. xPos, yPos, zPos uses setPosition( x, y, z ) - Sets the x position of the camera in the global system. Camera Position uses setPosition( x, y, z ) - Showz and sets the camera position at [x,y,z] in the global Reset - Resets the camera position and all controls except Focal Look At [Set] - lookAt( x, y, z ) - rotates the camera to point to a global coordinate point - direction of view Focal - setFocal( nodal distance ) - Sets the focal ( nodal ) distance of the camera- in effect a zoom lens
Notes
1 When you use Look At to point the camera in a certain direction, earlier rotations in the camera's own coordinate system are lost. The corresponding controls are not updated.
2 The reset button will reset the the camera position ad orientation, as well as all controls except the focal or nodal distance control.
3 The moveUpwards() function seems to move the camera in the opposite direction in this version, which is probably a bug.
Links
Tutorial: Petit Publications
The Sandy 3D library and API.