OpenGL, C++, Scaling a texture within a quad.
i want to make several 'sprite' quads with a single texture that has all the frames of animation on it, and just offset the texture to the right place.
I can offset the texture within the quad, but the problem is, the texture is scaled to fit inside the quad, showing the whole sprite sheet, how to i keep it from doing that?
Quote:Original post by GraviousScale your texture coordinates. Typically one uses texture coordinates in the range [0, 1], which displays the entire texture. To display only the first half of your texture, halve the range: [0, 0.5].
I can offset the texture within the quad, but the problem is, the texture is scaled to fit inside the quad, showing the whole sprite sheet, how to i keep it from doing that?
Quote:Original post by swiftcoderQuote:Original post by GraviousScale your texture coordinates. Typically one uses texture coordinates in the range [0, 1], which displays the entire texture. To display only the first half of your texture, halve the range: [0, 0.5].
I can offset the texture within the quad, but the problem is, the texture is scaled to fit inside the quad, showing the whole sprite sheet, how to i keep it from doing that?
There we go, thats what i wanted :D thanks
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement