File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -32,25 +32,23 @@ <h2>Code Example</h2>
3232 .setWeightAttribute( 'color' )
3333 .build();
3434
35- const sampleMesh = new THREE.InstancedMesh( sampleGeometry, sampleMaterial, 100 );
35+ const mesh = new THREE.InstancedMesh( sampleGeometry, sampleMaterial, 100 );
3636
37- const _position = new THREE.Vector3();
38- const _matrix = new THREE.Matrix4();
37+ const position = new THREE.Vector3();
38+ const matrix = new THREE.Matrix4();
3939
4040 // Sample randomly from the surface, creating an instance of the sample
4141 // geometry at each sample point.
4242 for ( let i = 0; i < 100 ; i ++ ) {
4343
44- sampler.sample( _position );
44+ sampler.sample( position );
4545
46- _matrix .makeTranslation( _position .x, _position .y, _position .z );
46+ matrix .makeTranslation( position .x, position .y, position .z );
4747
48- mesh.setMatrixAt( i, _matrix );
48+ mesh.setMatrixAt( i, matrix );
4949
5050 }
5151
52- mesh.instanceMatrix.needsUpdate = true;
53-
5452 scene.add( mesh );
5553 </ code >
5654
You can’t perform that action at this time.
0 commit comments