diff --git a/examples/webgl_sandbox.html b/examples/webgl_sandbox.html
index 7260b58d..3fac70f2 100644
--- a/examples/webgl_sandbox.html
+++ b/examples/webgl_sandbox.html
@@ -52,13 +52,13 @@
-
-
+
+
@@ -84,6 +84,7 @@
+
@@ -101,12 +102,15 @@
+
+
+
@@ -118,7 +122,10 @@
+
+
+
diff --git a/src/core/Matrix4.js b/src/core/Matrix4.js
index a41df09e..8f91053e 100644
--- a/src/core/Matrix4.js
+++ b/src/core/Matrix4.js
@@ -69,6 +69,21 @@ THREE.Matrix4.prototype = {
lookAt : function ( eye, center, up ) {
+ /*
+ var x = THREE.Matrix4.__v1, y = THREE.Matrix4.__v2, z = THREE.Matrix4.__v3;
+
+ z.sub( center, eye ).normalize();
+ x.cross( up, z ).normalize();
+ y.cross( z, x ).normalize();
+
+ this.n11 = x.x; this.n12 = x.y; this.n13 = x.z; this.n14 = - x.dot( eye );
+ this.n21 = y.x; this.n22 = y.y; this.n23 = y.z; this.n24 = - y.dot( eye );
+ this.n31 = z.x; this.n32 = z.y; this.n33 = z.z; this.n34 = - z.dot( eye );
+ this.n41 = 0; this.n42 = 0; this.n43 = 0; this.n44 = 1;
+
+ return this;
+ */
+
var x = THREE.Matrix4.__v1, y = THREE.Matrix4.__v2, z = THREE.Matrix4.__v3;
z.sub( eye, center ).normalize();
diff --git a/src/core/Vector3.js b/src/core/Vector3.js
index a15db9a0..4a866cd3 100644
--- a/src/core/Vector3.js
+++ b/src/core/Vector3.js
@@ -290,14 +290,14 @@ THREE.Vector3.prototype = {
setRotationFromMatrix : function ( m ) {
- this.y = Math.asin( m.n13 );
-
var cosY = Math.cos( this.y );
+ this.y = Math.asin( m.n13 );
+
if ( Math.abs( cosY ) > 0.00001 ) {
this.x = Math.atan2( - m.n23 / cosY, m.n33 / cosY );
- this.z = Math.atan2( - m.n13 / cosY, m.n11 / cosY );
+ this.z = Math.atan2( - m.n12 / cosY, m.n11 / cosY );
} else {
diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js
index 3c82ade8..596bc4ed 100644
--- a/src/renderers/WebGLRenderer.js
+++ b/src/renderers/WebGLRenderer.js
@@ -4538,6 +4538,7 @@ THREE.WebGLRenderer = function ( parameters ) {
} else {
_gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture );
+ // _gl.texImage2D( _gl.TEXTURE_2D, 0, _gl.RGBA, _gl.RGBA, _gl.UNSIGNED_BYTE, texture.image );
_gl.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, _gl.RGBA, _gl.UNSIGNED_BYTE, texture.image );
}
@@ -4580,6 +4581,7 @@ THREE.WebGLRenderer = function ( parameters ) {
for ( var i = 0; i < 6; ++i ) {
+ // _gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, _gl.RGBA, _gl.RGBA, _gl.UNSIGNED_BYTE, texture.image[ i ] );
_gl.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, _gl.RGBA, _gl.UNSIGNED_BYTE, texture.image[ i ] );
}