diff --git a/examples/webgl_camera.html b/examples/webgl_camera.html index 7f13205d299e207d998e2e8731c07517f9e957b3..62db11867c5dfe34aab7d9c2de2ae21840afc5b9 100644 --- a/examples/webgl_camera.html +++ b/examples/webgl_camera.html @@ -120,19 +120,19 @@ // - var geometry = new THREE.Geometry(); + var geometry = new THREE.BufferGeometry(); + var vertices = []; for ( var i = 0; i < 10000; i ++ ) { - var vertex = new THREE.Vector3(); - vertex.x = THREE.Math.randFloatSpread( 2000 ); - vertex.y = THREE.Math.randFloatSpread( 2000 ); - vertex.z = THREE.Math.randFloatSpread( 2000 ); - - geometry.vertices.push( vertex ); + vertices.push( THREE.Math.randFloatSpread( 2000 ) ); // x + vertices.push( THREE.Math.randFloatSpread( 2000 ) ); // y + vertices.push( THREE.Math.randFloatSpread( 2000 ) ); // z } + geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) ); + var particles = new THREE.Points( geometry, new THREE.PointsMaterial( { color: 0x888888 } ) ); scene.add( particles ); @@ -142,7 +142,6 @@ renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT ); - renderer.domElement.style.position = "relative"; container.appendChild( renderer.domElement ); renderer.autoClear = false; diff --git a/examples/webgl_lines_dashed.html b/examples/webgl_lines_dashed.html index c5811e60577e091140c94151e35936b0effc3e4e..777c14d3a525ef27f6e797cc7a397652117a8637 100644 --- a/examples/webgl_lines_dashed.html +++ b/examples/webgl_lines_dashed.html @@ -66,7 +66,7 @@ var spline = new THREE.CatmullRomCurve3( points ); var samples = spline.getPoints( points.length * subdivisions ); - var geometrySpline = new THREE.Geometry().setFromPoints( samples ); + var geometrySpline = new THREE.BufferGeometry().setFromPoints( samples ); var line = new THREE.Line( geometrySpline, new THREE.LineDashedMaterial( { color: 0xffffff, dashSize: 1, gapSize: 0.5 } ) ); line.computeLineDistances(); diff --git a/examples/webgl_physics_cloth.html b/examples/webgl_physics_cloth.html index a0677b95df4563f9eca85afd331ee6366afb3f63..e6c192895cb103c69c2749623c5f44e3541c6da6 100644 --- a/examples/webgl_physics_cloth.html +++ b/examples/webgl_physics_cloth.html @@ -301,7 +301,7 @@ function createParalellepiped( sx, sy, sz, mass, pos, quat, material ) { - var threeObject = new THREE.Mesh( new THREE.BoxGeometry( sx, sy, sz, 1, 1, 1 ), material ); + var threeObject = new THREE.Mesh( new THREE.BoxBufferGeometry( sx, sy, sz, 1, 1, 1 ), material ); var shape = new Ammo.btBoxShape( new Ammo.btVector3( sx * 0.5, sy * 0.5, sz * 0.5 ) ); shape.setMargin( margin ); diff --git a/examples/webgl_physics_rope.html b/examples/webgl_physics_rope.html index e8f1accc5c1b13308d262c0fd704ffcfd61519c2..25abbc6f6a504b9008c189d674e7d7f6dc6b99b5 100644 --- a/examples/webgl_physics_rope.html +++ b/examples/webgl_physics_rope.html @@ -1,49 +1,48 @@ -
-