aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhwc4872012-06-29 15:13:14 -0700
committerhwc4872012-06-29 15:13:14 -0700
commitab80aa9c7da912db384ec48c656f84fd673b5253 (patch)
tree78e9cea2df2a77b431bfbb3ae460125f54081d2e
parent44eba9c1f7935ae13e87a6dcf6ddea0efa63eb05 (diff)
downloadninja-ab80aa9c7da912db384ec48c656f84fd673b5253.tar.gz
'V' texture map coordinate was inverted in some cases.
-rwxr-xr-xjs/lib/geom/circle.js12
-rwxr-xr-xjs/lib/geom/rectangle.js2
2 files changed, 2 insertions, 12 deletions
diff --git a/js/lib/geom/circle.js b/js/lib/geom/circle.js
index 374dda58..11c6dd33 100755
--- a/js/lib/geom/circle.js
+++ b/js/lib/geom/circle.js
@@ -401,16 +401,6 @@ exports.Circle = Object.create(GeomObj, {
401 401
402 this.recalcTexMapCoords( vrts, uvs ); 402 this.recalcTexMapCoords( vrts, uvs );
403 403
404// //refine the mesh for vertex deformations
405// if (material) {
406// if (material.hasVertexDeformation()) {
407// var paramRange = material.getVertexDeformationRange();
408// var tolerance = material.getVertexDeformationTolerance();
409// ShapePrimitive.refineMesh( vrts, nrms, uvs, indices, vrts.length/3, paramRange, tolerance );
410// }
411// }
412
413// return ShapePrimitive.create(vrts, nrms, uvs, indices, RDGE.globals.engine.getContext().renderer.TRIANGLES, index);
414 // refine the mesh for vertex deformations 404 // refine the mesh for vertex deformations
415 var rtnArray; 405 var rtnArray;
416 if (material) 406 if (material)
@@ -919,7 +909,7 @@ exports.Circle = Object.create(GeomObj, {
919 if (uvs[iuv] > uMax) uMax = uvs[iuv]; 909 if (uvs[iuv] > uMax) uMax = uvs[iuv];
920 910
921 iuv++; ivrt++; 911 iuv++; ivrt++;
922 uvs[iuv] = (vrts[ivrt]-yMin)/ovalHeight; 912 uvs[iuv] = 1.0 - (vrts[ivrt]-yMin)/ovalHeight;
923 if (uvs[iuv] < vMin) vMin = uvs[iuv]; 913 if (uvs[iuv] < vMin) vMin = uvs[iuv];
924 if (uvs[iuv] > vMax) vMax = uvs[iuv]; 914 if (uvs[iuv] > vMax) vMax = uvs[iuv];
925 iuv++; ivrt += 2; 915 iuv++; ivrt += 2;
diff --git a/js/lib/geom/rectangle.js b/js/lib/geom/rectangle.js
index ac8e6c70..91729c8e 100755
--- a/js/lib/geom/rectangle.js
+++ b/js/lib/geom/rectangle.js
@@ -1030,7 +1030,7 @@ RectangleFill.getVertex = function( index ) {
1030 1030
1031RectangleFill.getUV = function( x, y, xMin, w, yMin, h) { 1031RectangleFill.getUV = function( x, y, xMin, w, yMin, h) {
1032 var u = (x - xMin)/w, 1032 var u = (x - xMin)/w,
1033 v = (y - yMin)/h; 1033 v = 1.0 - (y - yMin)/h;
1034 1034
1035 var uv = [ u, v ]; 1035 var uv = [ u, v ];
1036 return uv; 1036 return uv;