Browse Source

CSS3DRenderer: fixed bug in billboard matrix creation.

This was causing vortex-looking bug when panning camera with TrackballControls on right click drag.
alteredq 12 years ago
parent
commit
36ecec28c8
1 changed files with 5 additions and 0 deletions
  1. 5 0
      examples/js/renderers/CSS3DRenderer.js

+ 5 - 0
examples/js/renderers/CSS3DRenderer.js

@@ -165,6 +165,11 @@ THREE.CSS3DRenderer = function () {
 					_tmpMatrix.transpose();
 					_tmpMatrix.extractPosition( object.matrixWorld );
 
+					_tmpMatrix.elements[ 3 ] = 0;
+					_tmpMatrix.elements[ 7 ] = 0;
+					_tmpMatrix.elements[ 11 ] = 0;
+					_tmpMatrix.elements[ 15 ] = 1;
+
 					style = getObjectCSSMatrix( _tmpMatrix );
 
 				} else {