Mirroring a texture
Is there any way to mirror a texture across a polygon in OpenGL? Like if I have a texture which is just the left half of a tree, I want to apply this texture to a single quad mirrored to draw an entire tree, drawing the texture on the left and a mirror image of it on the right. I can't just use two quads because I'm just rendering pre-defined meshes and textures which do this.
Yes, change the texture wrap modes
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement