Open main menu

CDOT Wiki β

Changes

Canvas3D JS Library

949 bytes added, 08:36, 30 January 2008
Vector Class
A Vector basically describes a direction in the form of X, Y, and Z coordinates of a 3D world. Basic 3D math cannot exist without the utilization of spatial coordinates which the Vector Class encapsulates. The Vector Class will have the following members within it:
* void NormalizeGetters** getX() - '''Retrieves the X value'''** getY() - '''Retrieves the Y value'''** getZ() - '''Retrieves the Z value''' * Setters** set(newX, newY, newZ) - '''This sets new (x, y, z) values to the Vector'''** setX(newX) - '''Takes a number value as the new value for X'''** setY(newY) - '''Takes a number value as the new value for Y'''** setZ(newZ) - '''Takes a number value as the new value for Z'''** setFromVector(vec) - '''Takes a Vector object as the new value for this Vector''' * Calculations** normalize() - '''Unit Normalization'''* float Dot* dot() - '''Calculates the Dot Product. Returns a number'''* float Length* length() - '''Returns the Length of Vector from (0, 0, 0)'''* float LengthSquared* lengthSq() - '''Returns the Squared value of Length'''* Vector Cross* cross(Vectorvec) - '''Takes a Vector object and computes the Cross Productbetween the two values. Returns a Vector object that is the cross of the two'''* * add(vec) - '''Takes a Vector Multiplyobject and adds its values to its own'''** subtract(Floatvec) - '''Multiplication by Takes a scalarVector object and subtracts its values from its own'''* Vector Divide* multiply(Floatscalar) - '''Division Takes a number value and multiplies (x, y, z) by a scalarit'''* Vector Subtract* divide(Vectorscalar) - '''Subtraction of Takes a Vectornumber value and divides (x, y, z) by it'''* Vector Add* isEqual(Vectorvec) - '''Addition to Takes a Vectorobject and compares it to its (x, y, z) values. Returns true if they match'''* bool Equals* multiplyByQuat(Vectorquat) - '''Equals ComparisonTakes a Quaternion and multiplies its orientation by (x, y, z). It returns a new Vector orientation'''
=== Matrix Class ===
1
edit