ncannasse пре 11 година
родитељ
комит
4105c814cf
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      h3d/scene/Sprite.hx

+ 5 - 1
h3d/scene/Sprite.hx

@@ -38,7 +38,11 @@ class Sprite extends Object {
 			return;
 		}
 		var p = new h3d.Vector(absPos._41, absPos._42, absPos._43);
-		p.project(ctx.camera.m);
+		p.transform(ctx.camera.m);
+		if( p.z < 0 ) return;
+		p.x /= p.w;
+		p.y /= p.w;
+		p.z /= p.w;
 		element.shader.zValue = depthTest ? p.z : 0;
 		if( !dummy.allocated )
 			dummy.onAlloc();