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

mesh.overdraw clean up.

上级 98091013
......@@ -77,7 +77,6 @@
for ( var i = 0; i < 100; i ++ ) {
var cube = new THREE.Mesh( geometry, material );
cube.overdraw = true;
cube.scale.y = Math.floor( Math.random() * 2 + 1 );
......
......@@ -143,7 +143,6 @@
for ( var i = 0; i < 100; i ++ ) {
var cube = new THREE.Mesh( geometry, material );
cube.overdraw = true;
cube.scale.y = Math.floor( Math.random() * 2 + 1 );
......
......@@ -71,14 +71,12 @@
cube = new THREE.Mesh( new THREE.CubeGeometry( 200, 200, 200, 1, 1, 1, materials ), new THREE.MeshFaceMaterial() );
cube.position.y = 150;
cube.overdraw = true;
scene.add( cube );
// Plane
plane = new THREE.Mesh( new THREE.PlaneGeometry( 200, 200 ), new THREE.MeshBasicMaterial( { color: 0xe0e0e0 } ) );
plane.rotation.x = - 90 * ( Math.PI / 180 );
plane.overdraw = true;
scene.add( plane );
renderer = new THREE.CanvasRenderer();
......
......@@ -58,7 +58,6 @@
for ( var i = 0; i < 200; i ++ ) {
var mesh = new THREE.Mesh( geometry, material );
mesh.overdraw = true;
mesh.position.x = Math.random() * 2000 - 1000;
mesh.position.y = Math.random() * 2000 - 1000;
mesh.position.z = Math.random() * 2000 - 1000;
......
......@@ -147,13 +147,12 @@
var position = new THREE.Vector3().add( intersects[ 0 ].point, intersects[ 0 ].object.matrixRotationWorld.multiplyVector3( intersects[ 0 ].face.normal.clone() ) );
var voxel = new THREE.Mesh( new THREE.CubeGeometry( 50, 50, 50 ), new THREE.MeshLambertMaterial( { color: 0x00ff80, opacity: 1, shading: THREE.FlatShading } ) );
var voxel = new THREE.Mesh( new THREE.CubeGeometry( 50, 50, 50 ), new THREE.MeshLambertMaterial( { color: 0x00ff80, opacity: 1 } ) );
voxel.position.x = Math.floor( position.x / 50 ) * 50 + 25;
voxel.position.y = Math.floor( position.y / 50 ) * 50 + 25;
voxel.position.z = Math.floor( position.z / 50 ) * 50 + 25;
voxel.matrixAutoUpdate = false;
voxel.updateMatrix();
voxel.overdraw = true;
scene.add( voxel );
}
......
......@@ -66,10 +66,9 @@
// Plane
var material = new THREE.MeshDepthMaterial();
var material = new THREE.MeshDepthMaterial( { overdraw: true } );
plane = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000, 10, 10 ), material );
plane.overdraw = true;
plane.doubleSided = true;
plane.rotation.x = - 90 * ( Math.PI / 180 );
......@@ -77,7 +76,7 @@
scene.add( plane );
// Spheres
// Cubes
geometry = new THREE.CubeGeometry( 100, 100, 100 );
material = new THREE.MeshDepthMaterial( { near: 1, far: 2000, overdraw: true } );
......
......@@ -116,7 +116,6 @@
mesh.scale.x = mesh.scale.y = mesh.scale.z = 1.5;
mesh.rotation.x = 180 * Math.PI / 180;
mesh.doubleSided = true;
mesh.overdraw = true;
scene.add( mesh );
//
......
......@@ -109,7 +109,6 @@
text.rotation.x = 0;
text.rotation.y = Math.PI * 2;
text.overdraw = true;
parent = new THREE.Object3D();
parent.add( text );
......
......@@ -121,7 +121,6 @@
lightMesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: 0xffaa00 } ) );
lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;
lightMesh.position = pointLight.position;
lightMesh.overdraw = true;
scene.add( lightMesh );
......
......@@ -226,8 +226,7 @@
zmesh = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial() );
zmesh.position.set( -80, FLOOR, 50 );
zmesh.scale.x = zmesh.scale.y = zmesh.scale.z = 3;
zmesh.overdraw = true;
zmesh.scale.set( 3, 3, 3 );
scene.add( zmesh );
// PLANES with all materials from the model
......
......@@ -127,8 +127,6 @@
mesh.scale.x = mesh.scale.y = mesh.scale.z = 0.25 * ( Math.random() + 0.5 );
mesh.overdraw = true;
scene.add( mesh );
}
......@@ -202,7 +200,6 @@
zmesh = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial() );
zmesh.position.set( x, y, z );
zmesh.scale.set( 3, 3, 3 );
zmesh.overdraw = true;
scene.add( zmesh );
createMaterialsPalette( geometry.materials, 100, b );
......
......@@ -84,8 +84,6 @@
mesh.position.set( x, y, z );
mesh.rotation.set( rx, ry, rz );
mesh.overdraw = true;
scene.add( mesh );
}
......@@ -121,7 +119,6 @@
lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0xffaa00 } ) );
lightMesh.scale.set( 0.05, 0.05, 0.05 );
lightMesh.position = pointLight.position;
lightMesh.overdraw = true;
scene.add( lightMesh );
// material samples
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册