Code: Select all
//calculating texture co-ordinates
for(short i = 0; i < MAX_SEGMENTS; ++i)
{
CCPoint pt = hillBottomVertices[i];
hillBottomTexCoords[i].x = pt.x/(terrainBottomTexSize/CC_CONTENT_SCALE_FACTOR());
hillBottomTexCoords[i].y = 1.0f - pt.y/(terrainBottomTexSize/CC_CONTENT_SCALE_FACTOR());
CCLOG("point: %f %f", hillBottomTexCoords[i].x, hillBottomTexCoords[i].y);
}
point: 0.937500 0.594344
point: 0.937500 1.000000
point: 1.093750 0.565063
point: 1.093750 1.000000
point: 2.031250 0.347375
point: 2.031250 1.000000 …so on
point: 166.875000 0.280531
point: 166.875000 1.000000 … till
point: 260.937500 0.308594
point: 260.937500 1.000000 .. until the X co-ordinates goes beyond 256 which is also the size of the texture(size = 256) ..that the stretch starts to appear.
is there any solution which can be used to handle this issue. Any Suggestions