Explorar o código

Fixed sprites in dynamic cubemap cars example.

alteredq %!s(int64=13) %!d(string=hai) anos
pai
achega
7f74694441
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  1. 8 2
      examples/webgl_materials_cubemap_dynamic.html

+ 8 - 2
examples/webgl_materials_cubemap_dynamic.html

@@ -306,7 +306,10 @@
 
 						var sprite = new THREE.Sprite( p );
 
-						sprite.scale.set( s, s, s );
+						var spriteWidth = 128;
+						var spriteHeight = 128;
+
+						sprite.scale.set( s * spriteWidth, s * spriteHeight, s );
 						sprite.position.set( x, y, z );
 
 						object.bodyMesh.add( sprite );
@@ -371,7 +374,10 @@
 
 						var sprite = new THREE.Sprite( p );
 
-						sprite.scale.set( s, s, s );
+						var spriteWidth = 128;
+						var spriteHeight = 128;
+
+						sprite.scale.set( s * spriteWidth, s * spriteHeight, s );
 						sprite.position.set( x, y, z );
 
 						object.bodyMesh.add( sprite );