From 44422ffdd0e828e3d99035015a32adac132f976e Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Mon, 18 Nov 2013 18:14:44 +0900 Subject: [PATCH] Examples fixes. --- examples/canvas_lines_sphere.html | 3 ++- examples/canvas_particles_random.html | 4 ++-- examples/canvas_particles_shapes.html | 17 ++--------------- examples/canvas_particles_waves.html | 8 +++++--- examples/index.html | 3 +-- examples/webgl_geometry_extrude_shapes.html | 2 +- examples/webgl_geometry_extrude_splines.html | 6 +++--- examples/webgl_interactive_voxelpainter.html | 2 +- ...hing_cubes.html => webgl_marchingcubes.html} | 0 examples/webgl_materials_grass.html | 1 + 10 files changed, 18 insertions(+), 28 deletions(-) rename examples/{webgl_marching_cubes.html => webgl_marchingcubes.html} (100%) diff --git a/examples/canvas_lines_sphere.html b/examples/canvas_lines_sphere.html index b44acde95a..06372a1afe 100644 --- a/examples/canvas_lines_sphere.html +++ b/examples/canvas_lines_sphere.html @@ -65,7 +65,7 @@ program: function ( context ) { context.beginPath(); - context.arc( 0, 0, 1, 0, PI2, true ); + context.arc( 0, 0, 0.5, 0, PI2, true ); context.fill(); } @@ -80,6 +80,7 @@ particle.position.z = Math.random() * 2 - 1; particle.position.normalize(); particle.position.multiplyScalar( Math.random() * 10 + 450 ); + particle.scale.multiplyScalar( 2 ); scene.add( particle ); } diff --git a/examples/canvas_particles_random.html b/examples/canvas_particles_random.html index 72fb38a374..94407e2623 100644 --- a/examples/canvas_particles_random.html +++ b/examples/canvas_particles_random.html @@ -48,7 +48,7 @@ var program = function ( context ) { context.beginPath(); - context.arc( 0, 0, 1, 0, PI2, true ); + context.arc( 0, 0, 0.5, 0, PI2, true ); context.fill(); } @@ -67,7 +67,7 @@ particle.position.x = Math.random() * 2000 - 1000; particle.position.y = Math.random() * 2000 - 1000; particle.position.z = Math.random() * 2000 - 1000; - particle.scale.x = particle.scale.y = Math.random() * 10 + 5; + particle.scale.x = particle.scale.y = Math.random() * 20 + 10; group.add( particle ); } diff --git a/examples/canvas_particles_shapes.html b/examples/canvas_particles_shapes.html index 48f746ed49..0337dd4fb0 100644 --- a/examples/canvas_particles_shapes.html +++ b/examples/canvas_particles_shapes.html @@ -132,25 +132,13 @@ heartShape.bezierCurveTo( x + 80, y + 35, x + 80, y, x + 50, y ); heartShape.bezierCurveTo( x + 35, y, x + 25, y + 25, x + 25, y + 25 ); - var circleLines = function ( context ) { - - context.lineWidth = 0.05; - context.beginPath(); - context.arc( 0, 0, 1, 0, Math.PI*2, true ); - context.stroke(); - - context.globalAlpha = 0.2; - context.fill(); - - } - var hue = 0; var hearts = function ( context ) { context.globalAlpha = 0.5; var x = 0, y = 0; - context.scale(0.1, -0.1); // Scale so canvas render can redraw within bounds + context.scale(0.05, -0.05); // Scale so canvas render can redraw within bounds context.beginPath(); // From http://blog.burlock.org/html5/130-paths context.bezierCurveTo( x + 2.5, y + 2.5, x + 2.0, y, x, y ); @@ -167,7 +155,6 @@ var setTargetParticle = function() { - //hearts circleLines var material = new THREE.SpriteCanvasMaterial( { program: hearts, blending:THREE.AdditiveBlending @@ -179,7 +166,7 @@ particle = new THREE.Sprite( material ); - particle.scale.x = particle.scale.y = Math.random() * 20 +20; + particle.scale.x = particle.scale.y = Math.random() * 40 + 40; particleCloud.add( particle ); return particle; diff --git a/examples/canvas_particles_waves.html b/examples/canvas_particles_waves.html index cda8bc6eab..5cd8f76197 100644 --- a/examples/canvas_particles_waves.html +++ b/examples/canvas_particles_waves.html @@ -57,7 +57,7 @@ program: function ( context ) { context.beginPath(); - context.arc( 0, 0, 1, 0, PI2, true ); + context.arc( 0, 0, 0.5, 0, PI2, true ); context.fill(); } @@ -169,8 +169,10 @@ for ( var iy = 0; iy < AMOUNTY; iy ++ ) { particle = particles[ i++ ]; - particle.position.y = ( Math.sin( ( ix + count ) * 0.3 ) * 50 ) + ( Math.sin( ( iy + count ) * 0.5 ) * 50 ); - particle.scale.x = particle.scale.y = ( Math.sin( ( ix + count ) * 0.3 ) + 1 ) * 2 + ( Math.sin( ( iy + count ) * 0.5 ) + 1 ) * 2; + particle.position.y = ( Math.sin( ( ix + count ) * 0.3 ) * 50 ) + + ( Math.sin( ( iy + count ) * 0.5 ) * 50 ); + particle.scale.x = particle.scale.y = ( Math.sin( ( ix + count ) * 0.3 ) + 1 ) * 4 + + ( Math.sin( ( iy + count ) * 0.5 ) + 1 ) * 4; } diff --git a/examples/index.html b/examples/index.html index cd3981e32c..a01adf71b0 100644 --- a/examples/index.html +++ b/examples/index.html @@ -134,7 +134,6 @@ "webgl_geometry_large_mesh", "webgl_geometry_minecraft", "webgl_geometry_minecraft_ao", - "webgl_geometry_minecraft_oculusrift", "webgl_geometry_normals", "webgl_geometry_nurbs", "webgl_geometry_shapes", @@ -178,7 +177,7 @@ "webgl_loader_vrml", "webgl_loader_vtk", "webgl_lod", - "webgl_marching_cubes", + "webgl_marchingcubes", "webgl_materials", "webgl_materials2", "webgl_materials_blending", diff --git a/examples/webgl_geometry_extrude_shapes.html b/examples/webgl_geometry_extrude_shapes.html index 850f13f125..c78c1901ba 100644 --- a/examples/webgl_geometry_extrude_shapes.html +++ b/examples/webgl_geometry_extrude_shapes.html @@ -72,7 +72,7 @@ // 3d shape - var mesh = THREE.SceneUtils.createMultiMaterialObject( geometry, [ new THREE.MeshLambertMaterial( { color: color, opacity: 0.2, transparent: true } ), new THREE.MeshBasicMaterial( { color: 0x000000, wireframe: true, opacity: 0.3 } ) ] ); + var mesh = THREE.SceneUtils.createMultiMaterialObject( geometry, [ new THREE.MeshLambertMaterial( { color: color } ), new THREE.MeshBasicMaterial( { color: 0x000000, wireframe: true, opacity: 0.3, transparent: true } ) ] ); mesh.position.set( x, y, z - 75 ); // mesh.rotation.set( rx, ry, rz ); diff --git a/examples/webgl_geometry_extrude_splines.html b/examples/webgl_geometry_extrude_splines.html index 82143ded73..9243465946 100644 --- a/examples/webgl_geometry_extrude_splines.html +++ b/examples/webgl_geometry_extrude_splines.html @@ -139,13 +139,13 @@ tubeMesh = THREE.SceneUtils.createMultiMaterialObject( geometry, [ new THREE.MeshLambertMaterial({ color: color, - opacity: geometry.debug ? 0.2 : 0.8, transparent: true }), new THREE.MeshBasicMaterial({ color: 0x000000, - opacity: 0.5, - wireframe: true + opacity: 0.3, + wireframe: true, + transparent: true })]); if ( geometry.debug ) tubeMesh.add( geometry.debug ); diff --git a/examples/webgl_interactive_voxelpainter.html b/examples/webgl_interactive_voxelpainter.html index 5bfc96ddeb..19079f9961 100644 --- a/examples/webgl_interactive_voxelpainter.html +++ b/examples/webgl_interactive_voxelpainter.html @@ -92,7 +92,7 @@ } - var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } ); + var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2, transparent: true } ); var line = new THREE.Line( geometry, material ); line.type = THREE.LinePieces; diff --git a/examples/webgl_marching_cubes.html b/examples/webgl_marchingcubes.html similarity index 100% rename from examples/webgl_marching_cubes.html rename to examples/webgl_marchingcubes.html diff --git a/examples/webgl_materials_grass.html b/examples/webgl_materials_grass.html index 75362c9364..7aebce0ffb 100644 --- a/examples/webgl_materials_grass.html +++ b/examples/webgl_materials_grass.html @@ -57,6 +57,7 @@ renderer = new THREE.WebGLRenderer(); renderer.sortObjects = false; + renderer.setClearColor( 0x003300 ); renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement ); -- GitLab