MathWorx

Class Scene3D

Object
   |
   +--Scene3D

class Scene3D


Scene3D defines a new 3D scene (shocking, I know). A 3D Scene has two main components: objects (to be displayed), and a camera (from which to view the objects). In this model of a 3D scene, the camera is the main mover, not the objects (though they can be moved). A view plane is defined through the origin with a normal in the direction from the origin to the camera; the objects are projected onto this view plane, which is then matched up with the 2D plane of the screen.
Most methods return this, so calls can be made sequentially.
Defined in Scene3D.js

Requires:


Field Summary
 point3D camera
          The "camera" is the point from which the objects are being viewed.
 Number focus
          The focus is the distance between the camera and the origin (in world coordinates)
 Array objects
          The objects to be viewed/displayed.
 Plane plane
          The view plane, onto which the objects are projected.
 
Constructor Summary
Scene3D(<Array> objs, <point3D> camera)
            The constructor function for a new Scene3D object.
 
Method Summary
 Scene3D addObject(<Object3D> obj)
           Add an object to the 3D Scene.
 void draw(<Array> objs, <Object> svg, <Object> settings)
           Draws the 3D scene, with the specified objects.
 Scene3D emptySVG(<Object> svg)
           Empties the SVG canvas supplied.
 Scene3D rotateCamera(<Number> theta, <Number> phi)
           Moves the camera to a new position.
 Scene3D setFocus(<Number> dist)
           Sets the focus (distance between Origin and camera).
 String toString()
           Returns a string representation of the Scene (camera and objects).

Field Detail

camera

point3D camera

focus

Number focus

objects

Array objects

plane

Plane plane

Constructor Detail

Scene3D

Scene3D(<Array> objs, <point3D> camera)

Method Detail

addObject

Scene3D addObject(<Object3D> obj)

draw

void draw(<Array> objs, <Object> svg, <Object> settings)

emptySVG

Scene3D emptySVG(<Object> svg)

rotateCamera

Scene3D rotateCamera(<Number> theta, <Number> phi)

setFocus

Scene3D setFocus(<Number> dist)

toString

String toString()

MathWorx

Documentation generated by JSDoc on Mon Aug 11 13:58:31 2008