提交 44422ffd 编写于 作者: M Mr.doob

Examples fixes.

上级 0f966c12
......@@ -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 );
}
......
......@@ -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 );
}
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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",
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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 );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册