Difference between revisions of "Canvas3D JS Library"
(→Matrix Class) |
(→Vector Class) |
||
Line 17: | Line 17: | ||
* float Length() - '''Length of Vector from (0, 0, 0)''' | * float Length() - '''Length of Vector from (0, 0, 0)''' | ||
* float LengthSquared() - '''Squared value of Length''' | * float LengthSquared() - '''Squared value of Length''' | ||
− | * Vector Cross(Vector | + | * Vector Cross(Vector) - '''Cross Product''' |
* Vector Multiply(Float) - '''Multiplication by a scalar''' | * Vector Multiply(Float) - '''Multiplication by a scalar''' | ||
* Vector Divide(Float) - '''Division by a scalar''' | * Vector Divide(Float) - '''Division by a scalar''' |
Revision as of 01:24, 5 January 2008
Contents
Introduciton
Under Construction
People Working On This Project
- Mark Paruzel (CodeBot)
- Andrew Smith
Math Operations
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 Normalize() - Unit Normalization
- float Dot() - Dot Product
- float Length() - Length of Vector from (0, 0, 0)
- float LengthSquared() - Squared value of Length
- Vector Cross(Vector) - Cross Product
- Vector Multiply(Float) - Multiplication by a scalar
- Vector Divide(Float) - Division by a scalar
- Vector Subtract(Vector) - Subtraction of a Vector
- Vector Add(Vector) - Addition to a Vector
- bool Equals(Vector) - Equals Comparison
Matrix Class
A Matrix Class is necessary to provide Matrix operations such as rotation, translation, and scaling to any point in the 3D world. It is composed of a 4x4 matrix of floating point values that can be applied to any Matrix operation. The Matrix Class has the following members:
- void Identity() - Create Identity Matrix
- void Transpose() - Transpose a Matrix
- void Inverse() - Inverse Matrix Values
- float Multiply(Matrix) - Multiplication by Scalar
- float Divide(Matrix) - Division by Scalar
- Matrix Add(Matrix) - Addition of two Matrices
- Matrix Subtract(Matrix) - Subtraction of two Matrices
- Vector Multiply(Vector) - Matrix times a Vector
- Matrix Multiply(Matrix) - Matrix times a Matrix