MathWorx

Class Object3D

Object
   |
   +--Object3D

class Object3D


Object3D is a class that defines 3D objects to displayed by Scene3D objects. A 3D object as defined is a face-vertex mesh. A face is an ordered list of vertex indices in the vertex array which are to be connected by lines. This model allows lines as well as surfaces and solids to all be Object3D objects.
Defined in Object3D.js

Requires:


Field Summary
 Array faces
          The array of faces.
 Array vertices
          The list of vertices of the 3D object.
 Array vertices2D
          The list of vertices after being projected onto a plane.
 
Constructor Summary
Object3D(<Array> vertices, <Array> faces)
            Creates a new 3D Object.
 
Method Summary
 Object3D addFace(<Array> vertices)
           Adds a face to the 3D Object.
 void draw(<Object> svg, <Object> settings)
           Draws the given object.
 Object3D to2D(<Number> focus)
           After object has been moved to Scene coordinates (via viewIn method), this performs a perspective transformation to put the object in the XY plane.
 Object3D toEach(<Function> func)
           Perform a function on each vertex of an object.
 String toString()
           Generates a string representation of the Object (a face-vertex mesh).
 Object3D translate(<Number> tx, <Number> ty, <Number> tz)
           Translate an object by tx, ty, and tz.
 Object3D viewIn(<Object> camera)
           Moves 3D object into new coordinates defined by 3D scene's camera.
<static> Object3D Cube(<Number> side, <point3D> center)
           Creates a new Cube as an Object3D object.
<static> Object3D Line(<Array> points)
           Creates a new line as an Object3D
<static> Object3D Sphere(<Number> rad, <point3D> cent, <Number> segments)
           Creates a new Sphere as an Object3D object.
<static> Object3D Xaxis(<Number> min, <Number> max)
           Creates a new 3D Object that is the x-axis.
<static> Object3D Yaxis(<Number> min, <Number> max)
           Creates a new 3D Object that is the y-axis.
<static> Object3D Zaxis(<Number> min, <Number> max)
           Creates a new 3D Object that is the z-axis.

Field Detail

faces

Array faces

vertices

Array vertices

vertices2D

Array vertices2D

Constructor Detail

Object3D

Object3D(<Array> vertices, <Array> faces)

Method Detail

addFace

Object3D addFace(<Array> vertices)

draw

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

to2D

Object3D to2D(<Number> focus)

toEach

Object3D toEach(<Function> func)

toString

String toString()

translate

Object3D translate(<Number> tx, <Number> ty, <Number> tz)

viewIn

Object3D viewIn(<Object> camera)

Cube

<static> Object3D Cube(<Number> side, <point3D> center)

Line

<static> Object3D Line(<Array> points)

Sphere

<static> Object3D Sphere(<Number> rad, <point3D> cent, <Number> segments)

Xaxis

<static> Object3D Xaxis(<Number> min, <Number> max)

Yaxis

<static> Object3D Yaxis(<Number> min, <Number> max)

Zaxis

<static> Object3D Zaxis(<Number> min, <Number> max)

MathWorx

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