Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Aug 28, 2023
1 parent 964ac14 commit becb6d7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions examples/geometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async function init() {
controls = new OrbitControls( camera, renderer.domElement );

// floor
const floor = new THREE.Mesh( new THREE.PlaneBufferGeometry(), new THREE.ShadowMaterial( { opacity: 0.05 } ) );
const floor = new THREE.Mesh( new THREE.PlaneGeometry(), new THREE.ShadowMaterial( { opacity: 0.05 } ) );
floor.material.color.set( 0xE0F7FA );
floor.rotation.x = - Math.PI / 2;
floor.scale.setScalar( 10 );
Expand Down Expand Up @@ -115,7 +115,7 @@ async function init() {

for ( let i = 0; i < 50; i ++ ) {

const b = new Brush( new THREE.SphereBufferGeometry( 1, 15, 15 ), material );
const b = new Brush( new THREE.SphereGeometry( 1, 15, 15 ), material );
b.receiveShadow = true;
scene.add( b );
brushes.push( b );
Expand Down
28 changes: 14 additions & 14 deletions examples/hierarchy.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,25 @@ async function init() {
wireframeObject.material.color.set( 0xffc400 ).multiplyScalar( 0.1 );
scene.add( wireframeObject );

root = new Operation( new THREE.BoxBufferGeometry( 10, 5, 5 ), brushMat );
root = new Operation( new THREE.BoxGeometry( 10, 5, 5 ), brushMat );
scene.add( root );

{

const inside = new Operation( new THREE.BoxBufferGeometry( 9, 4.5, 4 ), brushMat );
const inside = new Operation( new THREE.BoxGeometry( 9, 4.5, 4 ), brushMat );
inside.operation = SUBTRACTION;
root.add( inside );

}

{

const hole = new Operation( new THREE.CylinderBufferGeometry( 0.5, 0.5, 1, 20 ), brushMat );
const hole = new Operation( new THREE.CylinderGeometry( 0.5, 0.5, 1, 20 ), brushMat );
hole.operation = SUBTRACTION;
hole.rotateX( Math.PI / 2 );
hole.position.y = 0.25;

const hole2 = new Operation( new THREE.BoxBufferGeometry( 1, 2.5, 1 ), brushMat );
const hole2 = new Operation( new THREE.BoxGeometry( 1, 2.5, 1 ), brushMat );
hole2.operation = SUBTRACTION;
hole2.position.y = - 1;

Expand All @@ -141,19 +141,19 @@ async function init() {

{

const hole = new Operation( new THREE.BoxBufferGeometry( 2, 1.75, 2 ), brushMat );
const hole = new Operation( new THREE.BoxGeometry( 2, 1.75, 2 ), brushMat );
hole.operation = SUBTRACTION;

const frame = new Operation( new THREE.BoxBufferGeometry( 2, 1.75, 0.2 ), brushMat );
const frame = new Operation( new THREE.BoxGeometry( 2, 1.75, 0.2 ), brushMat );
frame.operation = ADDITION;

const hole2 = new Operation( new THREE.BoxBufferGeometry( 1.9, 1.65, 2 ), brushMat );
const hole2 = new Operation( new THREE.BoxGeometry( 1.9, 1.65, 2 ), brushMat );
hole2.operation = SUBTRACTION;

const bar1 = new Operation( new THREE.BoxBufferGeometry( 2, 0.1, 0.1 ), brushMat );
const bar1 = new Operation( new THREE.BoxGeometry( 2, 0.1, 0.1 ), brushMat );
bar1.operation = ADDITION;

const bar2 = new Operation( new THREE.BoxBufferGeometry( 0.1, 2, 0.1 ), brushMat );
const bar2 = new Operation( new THREE.BoxGeometry( 0.1, 2, 0.1 ), brushMat );
bar2.operation = ADDITION;

const windowGroup = new OperationGroup();
Expand All @@ -166,19 +166,19 @@ async function init() {

{

const hole = new Operation( new THREE.BoxBufferGeometry( 2, 1.75, 2 ), brushMat );
const hole = new Operation( new THREE.BoxGeometry( 2, 1.75, 2 ), brushMat );
hole.operation = SUBTRACTION;

const frame = new Operation( new THREE.BoxBufferGeometry( 2, 1.75, 0.2 ), brushMat );
const frame = new Operation( new THREE.BoxGeometry( 2, 1.75, 0.2 ), brushMat );
frame.operation = ADDITION;

const hole2 = new Operation( new THREE.BoxBufferGeometry( 1.9, 1.65, 2 ), brushMat );
const hole2 = new Operation( new THREE.BoxGeometry( 1.9, 1.65, 2 ), brushMat );
hole2.operation = SUBTRACTION;

const bar1 = new Operation( new THREE.BoxBufferGeometry( 2, 0.1, 0.1 ), brushMat );
const bar1 = new Operation( new THREE.BoxGeometry( 2, 0.1, 0.1 ), brushMat );
bar1.operation = ADDITION;

const bar2 = new Operation( new THREE.BoxBufferGeometry( 0.1, 2, 0.1 ), brushMat );
const bar2 = new Operation( new THREE.BoxGeometry( 0.1, 2, 0.1 ), brushMat );
bar2.operation = ADDITION;

const windowGroup = new OperationGroup();
Expand Down
12 changes: 6 additions & 6 deletions examples/multimaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function init() {
controls = new OrbitControls( camera, renderer.domElement );

// floor
const floor = new THREE.Mesh( new THREE.PlaneBufferGeometry(), new THREE.ShadowMaterial( { opacity: 0.05 } ) );
const floor = new THREE.Mesh( new THREE.PlaneGeometry(), new THREE.ShadowMaterial( { opacity: 0.05 } ) );
floor.material.color.set( 0xE0F7FA );
floor.rotation.x = - Math.PI / 2;
floor.scale.setScalar( 10 );
Expand All @@ -73,21 +73,21 @@ async function init() {
blueMaterial.color.set( 0x2979FF );

// basic pieces
const cylinder1 = new Brush( new THREE.CylinderBufferGeometry( 0.5, 0.5, 6, 45 ), blueMaterial );
const cylinder1 = new Brush( new THREE.CylinderGeometry( 0.5, 0.5, 6, 45 ), blueMaterial );
cylinder1.updateMatrixWorld();

const cylinder2 = new Brush( new THREE.CylinderBufferGeometry( 0.5, 0.5, 6, 45 ), blueMaterial );
const cylinder2 = new Brush( new THREE.CylinderGeometry( 0.5, 0.5, 6, 45 ), blueMaterial );
cylinder2.rotation.x = Math.PI / 2;
cylinder2.updateMatrixWorld();

const cylinder3 = new Brush( new THREE.CylinderBufferGeometry( 0.5, 0.5, 6, 45 ), blueMaterial );
const cylinder3 = new Brush( new THREE.CylinderGeometry( 0.5, 0.5, 6, 45 ), blueMaterial );
cylinder3.rotation.z = Math.PI / 2;
cylinder3.updateMatrixWorld();

const sphere = new Brush( new THREE.SphereBufferGeometry( 1, 50, 50 ), greenMaterial );
const sphere = new Brush( new THREE.SphereGeometry( 1, 50, 50 ), greenMaterial );
sphere.updateMatrixWorld();

const box = new Brush( new THREE.BoxBufferGeometry( 1.5, 1.5, 1.5 ), redMaterial );
const box = new Brush( new THREE.BoxGeometry( 1.5, 1.5, 1.5 ), redMaterial );
box.updateMatrixWorld();

// processing
Expand Down

0 comments on commit becb6d7

Please sign in to comment.