Global

Methods

Rotate(v, a) → {Matrix}

Source:
Parameters:
Name Type Description
v Vector
a Number

Angle in radians or use radians(90) to translate degrees

Returns:
Type
Matrix

Scale(v) → {Matrix}

Description:
  • return scaled matrix

Source:
Parameters:
Name Type Description
v Vector
Returns:
Type
Matrix

Translate(v) → {Matrix}

Description:
  • return translated matrix

Source:
Parameters:
Name Type Description
v Vector
Returns:
Type
Matrix

boxForShapes()

Description:
  • this file defines boxes for use in ray collision bounding boxes. This type of box does not draw anything and is never meant to. To draw a box, use a cube! :)

Source:

loadBinaryStl(path) → {Mesh}

Description:
  • Loads a model from binary STL file

Source:
Parameters:
Name Type Description
path String
Returns:
Type
Mesh

loadOBJ(path) → {Mesh}

Source:
Parameters:
Name Type Description
path String

to obj file "./file.obj"

Returns:
Type
Mesh

loadTextSTL(path) → {Mesh}

Description:
  • Loads a model from text STL file

Source:
Parameters:
Name Type Description
path String
Returns:
Type
Mesh

newDifference(shapes) → {BooleanShape}

Description:
  • Subtracts following shapes from the first shape in the list

Source:
Parameters:
Name Type Description
shapes Shapes | Primitives
Returns:
Type
BooleanShape

newIntersection(shapes) → {BooleanShape}

Description:
  • Intersects the first shape with everything after

Source:
Parameters:
Name Type Description
shapes Shape | Primitives
Returns:
Type
BooleanShape

newTransformedOutlineCone(eye, up, v0, v1, radius)

Description:
  • Draws The outline of a cone from the perspective of camera anwhere you want it as a transformed shape

Source:
Parameters:
Name Type Description
eye Vector
up Vector
v0 Vector
v1 Vector
radius float
Returns:

New transfromed shape with outline cone of said parameters

newTransformedOutlineCylinder(eye, up, v0, v1, radius) → {TransformedShape}

Source:
Parameters:
Name Type Description
eye Vector
up Vector
v0 Vector
v1 Vector
radius Number
Returns:
Type
TransformedShape

randomUnitVector()

Source:
Returns:

new Vector with Random x,y, and z normalized between 0-1

saveBinaryStl(mesh)

Description:
  • exports selected mesh as STL

Source:
Parameters:
Name Type Description
mesh Mesh

to be output