Hello,
I have 3d-models with 2d texture coordinates (s,t) outside the range [0,1]. Setting GL_TEXTURE_WRAP_S/T to GL_REPEAT via glTextParameter() makes OpenGL displaying the textures correctly.
For later processing, I indispensably need texture coordinates in the positive range (s,t>=0). The documentation says that OpenGL uses the fractional part of the coords as position and the integer part as number of repetitions - this means it should be possible to convert the texture coordinates of triangles/quads into the positive range somehow.
Using the absolute value of coordinates does not work at all. I’d really appreciate advise on how to convert the coordinates properly.
My program creates a 3d model output-file (containing vertex and texture coordinates not pixels) which will then be used in a different piece of software unfortunately only supporting positive texture coordinates.
Modulo 1? Then the integer part will be lost and thus the repetition won’t work, right? I definitely need to convert the vertex texture coordinates as they will later be written in the output-file.