Doc > Nodes > SOP > Subdivide

Doc > Nodes > SOP > Subdivide

Subdivides a geometry

Description

no description

Parameters

Name Type Description
subdivisions integer number of subdivisions

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 box = geo.createNode('box');

// add a subdivide node
const subdivide = geo.createNode('subdivide');
subdivide.setInput(0, box);
subdivide.flags.display.set(true);

// 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);