diff --git a/examples/geometry_vr.html b/examples/geometry_vr.html index e186f04b618875f7f85079237c6c8116f01e1682..143dad79eaedb6d81a32523afbdcb19a660c624a 100644 --- a/examples/geometry_vr.html +++ b/examples/geometry_vr.html @@ -65,18 +65,18 @@ wireframe = new THREE.MeshBasicMaterial( { color: 0xffffff, opacity: 0, wireframe: true } ); var context = texture_placeholder.getContext( '2d' ); - context.fillStyle = 'rgba( 200, 200, 200, 1 )'; + context.fillStyle = 'rgb( 200, 200, 200 )'; context.fillRect( 0, 0, texture_placeholder.width, texture_placeholder.height ); var materials = []; - materials.push( [ loadTexture( 'textures/skymap_px.jpg' ), wireframe ] ); - materials.push( [ loadTexture( 'textures/skymap_nx.jpg' ), wireframe ] ); - materials.push( [ loadTexture( 'textures/skymap_py.jpg' ), wireframe ] ); - materials.push( [ loadTexture( 'textures/skymap_ny.jpg' ), wireframe ] ); - materials.push( [ loadTexture( 'textures/skymap_pz.jpg' ), wireframe ] ); - materials.push( [ loadTexture( 'textures/skymap_nz.jpg' ), wireframe ] ); - - mesh = new THREE.Mesh( new Cube( 100, 100, 100, 7, 7, materials, true ), new THREE.MeshFaceMaterial() ); + materials.push( [ loadTexture( 'textures/skymap_px.jpg' ), wireframe ] ); // right + materials.push( [ loadTexture( 'textures/skymap_nx.jpg' ), wireframe ] ); // left + materials.push( [ loadTexture( 'textures/skymap_py.jpg' ), wireframe ] ); // top + materials.push( [ loadTexture( 'textures/skymap_ny.jpg' ), wireframe ] ); // bottom + materials.push( [ loadTexture( 'textures/skymap_pz.jpg' ), wireframe ] ); // back + materials.push( [ loadTexture( 'textures/skymap_nz.jpg' ), wireframe ] ); // front + + mesh = new THREE.Mesh( new Cube( 300, 300, 300, 7, 7, materials, true ), new THREE.MeshFaceMaterial() ); mesh.overdraw = true; scene.addObject( mesh ); diff --git a/examples/materials_cubemap_sky.html b/examples/materials_cubemap_sky.html index 9d057b3c37462308223d9744c275cb485996fe60..70dc6c1f38f642438bc7233a0f3f08b9a0d5f240 100644 --- a/examples/materials_cubemap_sky.html +++ b/examples/materials_cubemap_sky.html @@ -92,9 +92,9 @@ } var r = "textures/skymap_"; - var urls = [ r + "right1024.jpg", r + "left1024.jpg", - r + "top1024.jpg", r + "bottom1024.jpg", - r + "front1024.jpg", r + "back1024.jpg" ]; + var urls = [ r + "px.jpg", r + "nx.jpg", + r + "py.jpg", r + "ny.jpg", + r + "pz.jpg", r + "nz.jpg" ]; var images = loadImageArray( urls ); var material = new THREE.MeshBasicMaterial( { color: 0xffffff, env_map: new THREE.TextureCube( images ) } ); diff --git a/src/extras/primitives/Cube.js b/src/extras/primitives/Cube.js index 929234181f6eaca487677aba3f63d1fd13cfa2c1..ae2b3a4717941f3c7ca13ad9054d19b00c7689af 100644 --- a/src/extras/primitives/Cube.js +++ b/src/extras/primitives/Cube.js @@ -11,7 +11,7 @@ var Cube = function ( width, height, depth, segments_width, segments_height, mat width_half = width / 2, height_half = height / 2, depth_half = depth / 2, - flip = flipped !== undefined ? - 1 : 1; + flip = flipped ? - 1 : 1; if ( materials !== undefined ) { @@ -41,8 +41,8 @@ var Cube = function ( width, height, depth, segments_width, segments_height, mat buildPlane( 'z', 'y', 1 * flip, - 1, depth, height, - width_half, this.materials[ 1 ] ); // left buildPlane( 'x', 'z', - 1 * flip, - 1, width, depth, height_half, this.materials[ 2 ] ); // top buildPlane( 'x', 'z', - 1 * flip, 1, width, depth, - height_half, this.materials[ 3 ] ); // bottom - buildPlane( 'x', 'y', 1 * flip, - 1, width, height, depth_half, this.materials[ 4 ] ); // front - buildPlane( 'x', 'y', - 1 * flip, - 1, width, height, - depth_half, this.materials[ 5 ] ); // back + buildPlane( 'x', 'y', 1 * flip, - 1, width, height, depth_half, this.materials[ 4 ] ); // back + buildPlane( 'x', 'y', - 1 * flip, - 1, width, height, - depth_half, this.materials[ 5 ] ); // front function buildPlane( u, v, udir, vdir, width, height, depth, material ) {