File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ THREE.CSS3DRenderer = function () {
3030 var _widthHalf , _heightHalf ;
3131 var _projector = new THREE . Projector ( ) ;
3232
33+ var _tmpMatrix = new THREE . Matrix4 ( ) ;
34+
3335 this . domElement = document . createElement ( 'div' ) ;
3436
3537 this . domElement . style . overflow = 'hidden' ;
@@ -155,9 +157,21 @@ THREE.CSS3DRenderer = function () {
155157
156158 var element = object . element ;
157159
158- if ( object . billboard ) object . lookAt ( camera . position ) ;
160+ if ( object . billboard ) {
161+
162+ // http://swiftcoder.wordpress.com/2008/11/25/constructing-a-billboard-matrix/
163+
164+ _tmpMatrix . copy ( camera . matrixWorldInverse ) ;
165+ _tmpMatrix . transpose ( ) ;
166+ _tmpMatrix . extractPosition ( object . matrixWorld ) ;
167+
168+ style = getObjectCSSMatrix ( _tmpMatrix ) ;
159169
160- style = getObjectCSSMatrix ( object . matrixWorld ) ;
170+ } else {
171+
172+ style = getObjectCSSMatrix ( object . matrixWorld ) ;
173+
174+ }
161175
162176 /*
163177 element.style.WebkitBackfaceVisibility = 'hidden';
You can’t perform that action at this time.
0 commit comments