From ab80aa9c7da912db384ec48c656f84fd673b5253 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Fri, 29 Jun 2012 15:13:14 -0700 Subject: 'V' texture map coordinate was inverted in some cases. --- js/lib/geom/circle.js | 12 +----------- js/lib/geom/rectangle.js | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'js/lib') 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, { this.recalcTexMapCoords( vrts, uvs ); -// //refine the mesh for vertex deformations -// if (material) { -// if (material.hasVertexDeformation()) { -// var paramRange = material.getVertexDeformationRange(); -// var tolerance = material.getVertexDeformationTolerance(); -// ShapePrimitive.refineMesh( vrts, nrms, uvs, indices, vrts.length/3, paramRange, tolerance ); -// } -// } - -// return ShapePrimitive.create(vrts, nrms, uvs, indices, RDGE.globals.engine.getContext().renderer.TRIANGLES, index); // refine the mesh for vertex deformations var rtnArray; if (material) @@ -919,7 +909,7 @@ exports.Circle = Object.create(GeomObj, { if (uvs[iuv] > uMax) uMax = uvs[iuv]; iuv++; ivrt++; - uvs[iuv] = (vrts[ivrt]-yMin)/ovalHeight; + uvs[iuv] = 1.0 - (vrts[ivrt]-yMin)/ovalHeight; if (uvs[iuv] < vMin) vMin = uvs[iuv]; if (uvs[iuv] > vMax) vMax = uvs[iuv]; 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 ) { RectangleFill.getUV = function( x, y, xMin, w, yMin, h) { var u = (x - xMin)/w, - v = (y - yMin)/h; + v = 1.0 - (y - yMin)/h; var uv = [ u, v ]; return uv; -- cgit v1.2.3