Vec3() - newo2001/HTML5-Canvas-Wrapper GitHub Wiki

Description

Creates a Vec3 object.

Syntax

new Vec3(x, [y, z])

x (float)

A float (or int) value to represent the length of the vector's x-component.

y (float) [optional]

A float (or int) value to represent the length of the vector's y-component.
If y is not set it will be initialized with the value of the vector's x-component.

z (float) [optional]

A float (or int) value to represent the length of the vector's z-component.
If z is not set it will be initialized with the value of the vector's y-component.

Returns

A new Vec3 type with the specified lengths.

Example

let vec = new Vec3(1.5, 5, 3.25);
Creates a Vector of which the x-component is 1.5 long, the y-component is 5.0 long and the z-component is 3.25 long.

Notes

  • This is the constructor for the Vec3 type.
⚠️ **GitHub.com Fallback** ⚠️