|
@@ -96,53 +96,59 @@
|
|
|
scene.fog = new THREE.FogExp2( 0xffffff, 0.00015 );
|
|
|
|
|
|
// sides
|
|
|
-
|
|
|
+
|
|
|
var light = new THREE.Color( 0xffffff );
|
|
|
var shadow = new THREE.Color( 0x505050 );
|
|
|
|
|
|
var matrix = new THREE.Matrix4();
|
|
|
|
|
|
var pxGeometry = new THREE.PlaneGeometry( 100, 100 );
|
|
|
- pxGeometry.faces[ 0 ].vertexColors = [ light, shadow, shadow, light ];
|
|
|
+ pxGeometry.faces[ 0 ].vertexColors.push( light, shadow, light );
|
|
|
+ pxGeometry.faces[ 1 ].vertexColors.push( shadow, shadow, light );
|
|
|
pxGeometry.faceVertexUvs[ 0 ][ 0 ][ 0 ].y = 0.5;
|
|
|
- pxGeometry.faceVertexUvs[ 0 ][ 0 ][ 3 ].y = 0.5;
|
|
|
+ pxGeometry.faceVertexUvs[ 0 ][ 1 ][ 2 ].y = 0.5;
|
|
|
pxGeometry.applyMatrix( matrix.makeRotationY( Math.PI / 2 ) );
|
|
|
pxGeometry.applyMatrix( matrix.makeTranslation( 50, 0, 0 ) );
|
|
|
|
|
|
var nxGeometry = new THREE.PlaneGeometry( 100, 100 );
|
|
|
- nxGeometry.faces[ 0 ].vertexColors = [ light, shadow, shadow, light ];
|
|
|
+ nxGeometry.faces[ 0 ].vertexColors.push( light, shadow, light );
|
|
|
+ nxGeometry.faces[ 1 ].vertexColors.push( shadow, shadow, light );
|
|
|
nxGeometry.faceVertexUvs[ 0 ][ 0 ][ 0 ].y = 0.5;
|
|
|
- nxGeometry.faceVertexUvs[ 0 ][ 0 ][ 3 ].y = 0.5;
|
|
|
+ nxGeometry.faceVertexUvs[ 0 ][ 1 ][ 2 ].y = 0.5;
|
|
|
nxGeometry.applyMatrix( matrix.makeRotationY( - Math.PI / 2 ) );
|
|
|
nxGeometry.applyMatrix( matrix.makeTranslation( - 50, 0, 0 ) );
|
|
|
|
|
|
var pyGeometry = new THREE.PlaneGeometry( 100, 100 );
|
|
|
- pyGeometry.faces[ 0 ].vertexColors = [ light, light, light, light ];
|
|
|
+ pyGeometry.faces[ 0 ].vertexColors.push( light, light, light );
|
|
|
+ pyGeometry.faces[ 1 ].vertexColors.push( light, light, light );
|
|
|
pyGeometry.faceVertexUvs[ 0 ][ 0 ][ 1 ].y = 0.5;
|
|
|
- pyGeometry.faceVertexUvs[ 0 ][ 0 ][ 2 ].y = 0.5;
|
|
|
+ pyGeometry.faceVertexUvs[ 0 ][ 1 ][ 1 ].y = 0.5;
|
|
|
pyGeometry.applyMatrix( matrix.makeRotationX( - Math.PI / 2 ) );
|
|
|
pyGeometry.applyMatrix( matrix.makeTranslation( 0, 50, 0 ) );
|
|
|
|
|
|
var py2Geometry = new THREE.PlaneGeometry( 100, 100 );
|
|
|
- py2Geometry.faces[ 0 ].vertexColors = [ light, light, light, light ];
|
|
|
+ py2Geometry.faces[ 0 ].vertexColors.push( light, light, light );
|
|
|
+ py2Geometry.faces[ 1 ].vertexColors.push( light, light, light );
|
|
|
py2Geometry.faceVertexUvs[ 0 ][ 0 ][ 1 ].y = 0.5;
|
|
|
- py2Geometry.faceVertexUvs[ 0 ][ 0 ][ 2 ].y = 0.5;
|
|
|
+ py2Geometry.faceVertexUvs[ 0 ][ 1 ][ 1 ].y = 0.5;
|
|
|
py2Geometry.applyMatrix( matrix.makeRotationX( - Math.PI / 2 ) );
|
|
|
py2Geometry.applyMatrix( matrix.makeRotationY( Math.PI / 2 ) );
|
|
|
py2Geometry.applyMatrix( matrix.makeTranslation( 0, 50, 0 ) );
|
|
|
|
|
|
var pzGeometry = new THREE.PlaneGeometry( 100, 100 );
|
|
|
- pzGeometry.faces[ 0 ].vertexColors = [ light, shadow, shadow, light ];
|
|
|
+ pzGeometry.faces[ 0 ].vertexColors.push( light, shadow, light );
|
|
|
+ pzGeometry.faces[ 1 ].vertexColors.push( shadow, shadow, light );
|
|
|
pzGeometry.faceVertexUvs[ 0 ][ 0 ][ 0 ].y = 0.5;
|
|
|
- pzGeometry.faceVertexUvs[ 0 ][ 0 ][ 3 ].y = 0.5;
|
|
|
+ pzGeometry.faceVertexUvs[ 0 ][ 1 ][ 2 ].y = 0.5;
|
|
|
pzGeometry.applyMatrix( matrix.makeTranslation( 0, 0, 50 ) );
|
|
|
|
|
|
var nzGeometry = new THREE.PlaneGeometry( 100, 100 );
|
|
|
- nzGeometry.faces[ 0 ].vertexColors = [ light, shadow, shadow, light ];
|
|
|
+ nzGeometry.faces[ 0 ].vertexColors.push( light, shadow, light );
|
|
|
+ nzGeometry.faces[ 1 ].vertexColors.push( shadow, shadow, light );
|
|
|
nzGeometry.faceVertexUvs[ 0 ][ 0 ][ 0 ].y = 0.5;
|
|
|
- nzGeometry.faceVertexUvs[ 0 ][ 0 ][ 3 ].y = 0.5;
|
|
|
+ nzGeometry.faceVertexUvs[ 0 ][ 1 ][ 2 ].y = 0.5;
|
|
|
nzGeometry.applyMatrix( matrix.makeRotationY( Math.PI ) );
|
|
|
- nzGeometry.applyMatrix( matrix.makeTranslation( 0, 0, -50 ) );
|
|
|
+ nzGeometry.applyMatrix( matrix.makeTranslation( 0, 0, - 50 ) );
|
|
|
|
|
|
//
|
|
|
|
|
@@ -179,10 +185,14 @@
|
|
|
dummy.geometry = py2Geometry;
|
|
|
|
|
|
var colors = dummy.geometry.faces[ 0 ].vertexColors;
|
|
|
- colors[ 3 ] = a === 0 ? shadow : light;
|
|
|
colors[ 0 ] = b === 0 ? shadow : light;
|
|
|
colors[ 1 ] = c === 0 ? shadow : light;
|
|
|
- colors[ 2 ] = d === 0 ? shadow : light;
|
|
|
+ colors[ 2 ] = a === 0 ? shadow : light;
|
|
|
+
|
|
|
+ var colors = dummy.geometry.faces[ 1 ].vertexColors;
|
|
|
+ colors[ 0 ] = c === 0 ? shadow : light;
|
|
|
+ colors[ 1 ] = d === 0 ? shadow : light;
|
|
|
+ colors[ 2 ] = a === 0 ? shadow : light;
|
|
|
|
|
|
} else {
|
|
|
|
|
@@ -191,8 +201,12 @@
|
|
|
var colors = dummy.geometry.faces[ 0 ].vertexColors;
|
|
|
colors[ 0 ] = a === 0 ? shadow : light;
|
|
|
colors[ 1 ] = b === 0 ? shadow : light;
|
|
|
- colors[ 2 ] = c === 0 ? shadow : light;
|
|
|
- colors[ 3 ] = d === 0 ? shadow : light;
|
|
|
+ colors[ 2 ] = d === 0 ? shadow : light;
|
|
|
+
|
|
|
+ var colors = dummy.geometry.faces[ 1 ].vertexColors;
|
|
|
+ colors[ 0 ] = b === 0 ? shadow : light;
|
|
|
+ colors[ 1 ] = c === 0 ? shadow : light;
|
|
|
+ colors[ 2 ] = d === 0 ? shadow : light;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -204,7 +218,10 @@
|
|
|
|
|
|
var colors = dummy.geometry.faces[ 0 ].vertexColors;
|
|
|
colors[ 0 ] = pxpz > px && x > 0 ? shadow : light;
|
|
|
- colors[ 3 ] = pxnz > px && x > 0 ? shadow : light;
|
|
|
+ colors[ 2 ] = pxnz > px && x > 0 ? shadow : light;
|
|
|
+
|
|
|
+ var colors = dummy.geometry.faces[ 1 ].vertexColors;
|
|
|
+ colors[ 2 ] = pxnz > px && x > 0 ? shadow : light;
|
|
|
|
|
|
THREE.GeometryUtils.merge( geometry, dummy );
|
|
|
|
|
@@ -216,7 +233,10 @@
|
|
|
|
|
|
var colors = dummy.geometry.faces[ 0 ].vertexColors;
|
|
|
colors[ 0 ] = nxnz > nx && x < worldWidth - 1 ? shadow : light;
|
|
|
- colors[ 3 ] = nxpz > nx && x < worldWidth - 1 ? shadow : light;
|
|
|
+ colors[ 2 ] = nxpz > nx && x < worldWidth - 1 ? shadow : light;
|
|
|
+
|
|
|
+ var colors = dummy.geometry.faces[ 1 ].vertexColors;
|
|
|
+ colors[ 2 ] = nxpz > nx && x < worldWidth - 1 ? shadow : light;
|
|
|
|
|
|
THREE.GeometryUtils.merge( geometry, dummy );
|
|
|
|
|
@@ -228,7 +248,10 @@
|
|
|
|
|
|
var colors = dummy.geometry.faces[ 0 ].vertexColors;
|
|
|
colors[ 0 ] = nxpz > pz && z < worldDepth - 1 ? shadow : light;
|
|
|
- colors[ 3 ] = pxpz > pz && z < worldDepth - 1 ? shadow : light;
|
|
|
+ colors[ 2 ] = pxpz > pz && z < worldDepth - 1 ? shadow : light;
|
|
|
+
|
|
|
+ var colors = dummy.geometry.faces[ 1 ].vertexColors;
|
|
|
+ colors[ 2 ] = pxpz > pz && z < worldDepth - 1 ? shadow : light;
|
|
|
|
|
|
THREE.GeometryUtils.merge( geometry, dummy );
|
|
|
|
|
@@ -240,7 +263,10 @@
|
|
|
|
|
|
var colors = dummy.geometry.faces[ 0 ].vertexColors;
|
|
|
colors[ 0 ] = pxnz > nz && z > 0 ? shadow : light;
|
|
|
- colors[ 3 ] = nxnz > nz && z > 0 ? shadow : light;
|
|
|
+ colors[ 2 ] = nxnz > nz && z > 0 ? shadow : light;
|
|
|
+
|
|
|
+ var colors = dummy.geometry.faces[ 1 ].vertexColors;
|
|
|
+ colors[ 2 ] = nxnz > nz && z > 0 ? shadow : light;
|
|
|
|
|
|
THREE.GeometryUtils.merge( geometry, dummy );
|
|
|
|