Browse Source

Flipped UV debug viewer output. It was rendering upside down.

WestLangley 12 years ago
parent
commit
ee76e41b72
1 changed files with 4 additions and 4 deletions
  1. 4 4
      examples/js/UVsUtils.js

+ 4 - 4
examples/js/UVsUtils.js

@@ -137,9 +137,9 @@ THREE.UVsDebug = function(geometry) {
             a.y += u.y;
             
             if (j == 0) {
-                ctx.moveTo(u.x * width, u.y * height);
+                ctx.moveTo(u.x * width, ( 1 - u.y ) * height);
             } else {
-                ctx.lineTo(u.x * width, u.y * height);
+                ctx.lineTo(u.x * width, ( 1 - u.y ) * height);
             }
         }
         
@@ -151,7 +151,7 @@ THREE.UVsDebug = function(geometry) {
         // label the face number
         ctx.font = "12pt Arial bold";
         ctx.fillStyle = 'rgba(0,0,0,0.8)';
-        ctx.fillText(i, a.x * width, a.y * height);
+        ctx.fillText(i, a.x * width, ( 1 - a.y ) * height);
         
         ctx.font = "8pt Arial bold";
         ctx.fillStyle = 'rgba(30,30,0,0.8)';
@@ -165,7 +165,7 @@ THREE.UVsDebug = function(geometry) {
             b.x = u.x - b.x;
             b.y = u.y - b.y;
             ctx.fillText(abc[j]
-                + ':' + faces[i][abc[j]], b.x * width, b.y * height);
+                + ':' + faces[i][abc[j]], b.x * width, ( 1 - b.y ) * height);
         }
     
     }