From 825715b35594dde45bade8f6e7f9577d9ae2a550 Mon Sep 17 00:00:00 2001 From: alteredq Date: Thu, 5 Jul 2012 17:17:33 +0200 Subject: [PATCH] Unflipped CubeGeometry. --- build/Three.js | 4 ++-- build/custom/ThreeExtras.js | 4 ++-- src/extras/geometries/CubeGeometry.js | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build/Three.js b/build/Three.js index a75d073bb7..741ea76020 100644 --- a/build/Three.js +++ b/build/Three.js @@ -625,8 +625,8 @@ t=t-a};this.rotateRight=function(a){a===void 0&&(a=f());t=t+a};this.rotateUp=fun var c=c+t,d=d+q,d=Math.max(1.0E-6,Math.min(Math.PI-1.0E-6,d)),e=b.length();b.x=e*Math.sin(d)*Math.sin(c);b.y=e*Math.cos(d);b.z=e*Math.sin(d)*Math.cos(c);b.multiplyScalar(u);a.copy(this.center).addSelf(b);this.object.lookAt(this.center);q=t=0;u=1;if(w.distanceTo(this.object.position)>0){this.dispatchEvent(x);w.copy(this.object.position)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},false);this.domElement.addEventListener("mousedown",function(a){if(i.userRotate){a.preventDefault(); if(a.button===0||a.button===2){s=c;l.set(a.clientX,a.clientY)}else if(a.button===1){s=d;p.set(a.clientX,a.clientY)}document.addEventListener("mousemove",g,false);document.addEventListener("mouseup",h,false)}},false);this.domElement.addEventListener("mousewheel",function(a){i.userZoom&&(a.wheelDelta>0?i.zoomOut():i.zoomIn())},false)}; THREE.CubeGeometry=function(a,b,c,d,e,f,g,h){function i(a,b,c,g,h,i,l,m){var n,o=d||1,p=e||1,r=h/2,q=i/2,t=k.vertices.length;if(a==="x"&&b==="y"||a==="y"&&b==="x")n="z";else if(a==="x"&&b==="z"||a==="z"&&b==="x"){n="y";p=f||1}else if(a==="z"&&b==="y"||a==="y"&&b==="z"){n="x";o=f||1}var u=o+1,j=p+1,w=h/o,L=i/p,S=new THREE.Vector3;S[n]=l>0?1:-1;for(h=0;h0){this.vertices.push(new THREE.Vector3(0, g,0));for(h=0;h0){this.vertices.push(new THREE.Vector3(0,-g,0));for(h=0;h0){this.dispatchEvent(x);v.copy(this.object.position)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},false);this.domElement.addEventListener("mousedown",function(a){if(i.userRotate){a.preventDefault(); if(a.button===0||a.button===2){p=c;l.set(a.clientX,a.clientY)}else if(a.button===1){p=d;m.set(a.clientX,a.clientY)}document.addEventListener("mousemove",g,false);document.addEventListener("mouseup",h,false)}},false);this.domElement.addEventListener("mousewheel",function(a){i.userZoom&&(a.wheelDelta>0?i.zoomOut():i.zoomIn())},false)}; THREE.CubeGeometry=function(b,a,c,d,e,f,g,h){function i(a,b,c,g,h,i,k,m){var l,n=d||1,o=e||1,q=h/2,r=i/2,s=j.vertices.length;if(a==="x"&&b==="y"||a==="y"&&b==="x")l="z";else if(a==="x"&&b==="z"||a==="z"&&b==="x"){l="y";o=f||1}else if(a==="z"&&b==="y"||a==="y"&&b==="z"){l="x";n=f||1}var t=n+1,v=o+1,I=h/n,M=i/o,J=new THREE.Vector3;J[l]=k>0?1:-1;for(h=0;h0){this.vertices.push(new THREE.Vector3(0, g,0));for(h=0;h0){this.vertices.push(new THREE.Vector3(0,-g,0));for(h=0;h