|
@@ -207,12 +207,15 @@
|
|
var geometry = new THREE.BufferGeometry();
|
|
var geometry = new THREE.BufferGeometry();
|
|
|
|
|
|
var positions = new THREE.BufferAttribute( new Float32Array( 1000000 * 3 ), 3 );
|
|
var positions = new THREE.BufferAttribute( new Float32Array( 1000000 * 3 ), 3 );
|
|
|
|
+ positions.dynamic = true;
|
|
geometry.addAttribute( 'position', positions );
|
|
geometry.addAttribute( 'position', positions );
|
|
|
|
|
|
var normals = new THREE.BufferAttribute( new Float32Array( 1000000 * 3 ), 3 );
|
|
var normals = new THREE.BufferAttribute( new Float32Array( 1000000 * 3 ), 3 );
|
|
|
|
+ normals.dynamic = true;
|
|
geometry.addAttribute( 'normal', normals );
|
|
geometry.addAttribute( 'normal', normals );
|
|
|
|
|
|
var colors = new THREE.BufferAttribute( new Float32Array( 1000000 * 3 ), 3 );
|
|
var colors = new THREE.BufferAttribute( new Float32Array( 1000000 * 3 ), 3 );
|
|
|
|
+ colors.dynamic = true;
|
|
geometry.addAttribute( 'color', colors );
|
|
geometry.addAttribute( 'color', colors );
|
|
|
|
|
|
geometry.drawRange.count = 0;
|
|
geometry.drawRange.count = 0;
|
|
@@ -349,8 +352,29 @@
|
|
}
|
|
}
|
|
|
|
|
|
geometry.drawRange.count = count;
|
|
geometry.drawRange.count = count;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function updateGeometry( start, end ) {
|
|
|
|
+
|
|
|
|
+ if ( start === end ) return;
|
|
|
|
+
|
|
|
|
+ var offset = start * 3;
|
|
|
|
+ var count = ( end - start ) * 3;
|
|
|
|
+
|
|
|
|
+ var geometry = line.geometry;
|
|
|
|
+ var attributes = geometry.attributes;
|
|
|
|
+
|
|
|
|
+ attributes.position.updateRange.offset = offset;
|
|
|
|
+ attributes.position.updateRange.count = count;
|
|
attributes.position.needsUpdate = true;
|
|
attributes.position.needsUpdate = true;
|
|
|
|
+
|
|
|
|
+ attributes.normal.updateRange.offset = offset;
|
|
|
|
+ attributes.normal.updateRange.count = count;
|
|
attributes.normal.needsUpdate = true;
|
|
attributes.normal.needsUpdate = true;
|
|
|
|
+
|
|
|
|
+ attributes.color.updateRange.offset = offset;
|
|
|
|
+ attributes.color.updateRange.count = count;
|
|
attributes.color.needsUpdate = true;
|
|
attributes.color.needsUpdate = true;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -411,9 +435,13 @@
|
|
|
|
|
|
controls.update();
|
|
controls.update();
|
|
|
|
|
|
|
|
+ var count = line.geometry.drawRange.count;
|
|
|
|
+
|
|
handleController( controller1 );
|
|
handleController( controller1 );
|
|
handleController( controller2 );
|
|
handleController( controller2 );
|
|
|
|
|
|
|
|
+ updateGeometry( count, line.geometry.drawRange.count );
|
|
|
|
+
|
|
effect.render( scene, camera );
|
|
effect.render( scene, camera );
|
|
|
|
|
|
}
|
|
}
|