Changes

Jump to: navigation, search

Canvas3D JS Library

1,986 bytes added, 09:05, 30 January 2008
Math Operations
** isEqual(vec) - '''Takes a Vector object and compares it to its (x, y, z) values. Returns true if they match'''
** multiplyByQuat(quat) - '''Takes a Quaternion and multiplies its orientation by (x, y, z). It returns a new Vector orientation'''
 
=== Matrix Class ===
** addMatrix(mat) - '''Adds the values of two matrices together. It returns a new matrix'''
** subtractMatrix(mat) - '''Subtracts the values of the two matrices. It return a new matrix'''
 
 
=== Quaternion Class ===
A Quaternion is a 4-Dimensional representation of an orientation. It consists of a unit-length axis and an angle around that axis. It can function much like an orientation matrix but without the disadvantage of Gimble Lock. The Quaternion is stored as an array of 4 numbers, represented in the order of (w, x, y, z). The Quaternion Class has the following members:
 
* Getters
** getW() - '''Returns the numerical W component of the Quaternion'''
** getX() - '''Returns the numerical X component of the Quaternion'''
** getY() - '''Returns the numerical Y component of the Quaternion'''
** getZ() - '''Returns the numerical Z component of the Quaternion'''
** getMatrix() - '''Returns a Matrix object that reflects the orientation of the quaternion'''
** getAxisAngle(axis, angle) - '''Takes in two values, a Vector object and a Number. Converts the orientation of the quaternion into an axis Vector and an angle around it'''
 
* Setters
** setFromQuat(quat) - '''Sets this Quaternion with the same value as the one being passed in'''
** setFromMatrix(mat) - '''Creates a Quaternion orientation from the orientation of the Matrix object that is passed in'''
 
* Calculations
** length() - '''Returns the length of the Quaternion'''
** lengthSq() - '''Returns a number that represents the square of this Quaternion's length'''
** addQuat(quat) - '''Takes a Quaternion object that will be added to this Quaternion's internal (w, x, y, z) values'''
** subtractQuat(quat) - '''Takes a Quaternion object where its values will be subtracted from this Quaternion's (w, x, y, z) values'''
** multiplQuat(scalar) - '''Takes a number and multiplies its values by the Quaternion's (w, x, y, z) values'''
** conjugate() - '''Returns a Quaternion that is this Quaternion's conjugate'''
** dot(quat) - '''Takes a Quaternion and returns the Dot Product of the two'''
** normalize() - '''Normalizes the quaternion'''
** inverse() - '''Returns the inverse of this Quaternion'''
== Camera ==
1
edit

Navigation menu