Overview
In this section you'll find everything related to the VOLTS.Cube class
import { Cube, Vector } from 'volts';
// Creates a 3D Cube located at 0,0,0
// Extending 0.5 in each direction
const c = new Cube( new Vector(), 0.5 );
// vertex of the cube would be:
// [ 0.5, 0.5, 0.5 ]
// [ 0.5, 0.5, -0.5 ]
// [ 0.5, -0.5, 0.5 ]
// [ 0.5, -0.5, -0.5 ]
// [ -0.5, 0.5, 0.5 ]
// [ -0.5, 0.5, -0.5 ]
// [ -0.5, -0.5, 0.5 ]
// [ -0.5, -0.5, -0.5 ]
Cube.debugVisualize
When ran in Spark AR, this function dynamically instances 8 planes on the vertices, and assigns them a material with the color specified.
import { Cube, Vector } from 'volts';
const c = new Cube( new Vector(), 0.5 );
c.debugVisualize(0.3);
Last updated
Was this helpful?