Doc > Nodes > SOP > Tetrahedron

Doc > Nodes > SOP > Tetrahedron

Creates a tetrahedron

Description

no description

Parameters

Name Type Description
radius float radius of the tetrahedron
detail integer resolution of the tetrahedron
pointsOnly boolean sets to create only points
center vector3 center of the tetrahedron

Edit code in JsFiddle , Codepen , view in a new tab or Open in the Editor


// create a scene
const scene = new PolyScene();
const root = scene.root();

// create a box
const geo = root.createNode('geo');
const tetrahedron = geo.createNode('tetrahedron');
tetrahedron.p.radius.set(1);
tetrahedron.p.center.set([0, 0, 0]);
tetrahedron.p.detail.set(5);
tetrahedron.p.pointsOnly.set(false);

// add a light
root.createNode('hemisphereLight');

// create a camera
const perspectiveCamera1 = root.createNode('perspectiveCamera');
perspectiveCamera1.p.t.set([5, 5, 5]);
// add orbitControls
const events1 = perspectiveCamera1.createNode('eventsNetwork');
const orbitsControls = events1.createNode('cameraOrbitControls');
perspectiveCamera1.p.controls.setNode(orbitsControls);

// mount the viewer
const element = document.getElementById('app');
perspectiveCamera1.createViewer(element);