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 @@ - - Amjs softbody rope demo - - - - - + + Amjs softbody rope demo + + + + +
Ammo.js physics soft body rope demo
Press Q or A to move the arm.
-





Loading...
+





Loading...
- + - + - + diff --git a/examples/webgl_physics_terrain.html b/examples/webgl_physics_terrain.html index 284aeed107eea1d5650e792a3a55b1d2f1246f86..2dfbc1f5229d04418f1eb0f7c90ef0bdda95533f 100644 --- a/examples/webgl_physics_terrain.html +++ b/examples/webgl_physics_terrain.html @@ -321,7 +321,7 @@ case 1: // Sphere var radius = 1 + Math.random() * objectSize; - threeObject = new THREE.Mesh( new THREE.SphereGeometry( radius, 20, 20 ), createObjectMaterial() ); + threeObject = new THREE.Mesh( new THREE.SphereBufferGeometry( radius, 20, 20 ), createObjectMaterial() ); shape = new Ammo.btSphereShape( radius ); shape.setMargin( margin ); break; @@ -330,7 +330,7 @@ var sx = 1 + Math.random() * objectSize; var sy = 1 + Math.random() * objectSize; var sz = 1 + Math.random() * objectSize; - threeObject = new THREE.Mesh( new THREE.BoxGeometry( sx, sy, sz, 1, 1, 1 ), createObjectMaterial() ); + threeObject = new THREE.Mesh( new THREE.BoxBufferGeometry( sx, sy, sz, 1, 1, 1 ), createObjectMaterial() ); shape = new Ammo.btBoxShape( new Ammo.btVector3( sx * 0.5, sy * 0.5, sz * 0.5 ) ); shape.setMargin( margin ); break; @@ -338,7 +338,7 @@ // Cylinder var radius = 1 + Math.random() * objectSize; var height = 1 + Math.random() * objectSize; - threeObject = new THREE.Mesh( new THREE.CylinderGeometry( radius, radius, height, 20, 1 ), createObjectMaterial() ); + threeObject = new THREE.Mesh( new THREE.CylinderBufferGeometry( radius, radius, height, 20, 1 ), createObjectMaterial() ); shape = new Ammo.btCylinderShape( new Ammo.btVector3( radius, height * 0.5, radius ) ); shape.setMargin(margin); break; @@ -346,7 +346,7 @@ // Cone var radius = 1 + Math.random() * objectSize; var height = 2 + Math.random() * objectSize; - threeObject = new THREE.Mesh( new THREE.CylinderGeometry( 0, radius, height, 20, 2 ), createObjectMaterial() ); + threeObject = new THREE.Mesh( new THREE.ConeBufferGeometry( radius, height, 20, 2 ), createObjectMaterial() ); shape = new Ammo.btConeShape( radius, height ); break; }