1. ## Reverse quad - how?

I have two quads. The second one is just below the first one.
I have binded a texture on them.

I would like the second quad (or texture) upside-down and reversed. I have succeeded in getting it upside-down, but not reversed.

Code :
```// First quad
gl.glTexCoord2f(0.0f, 0.0f); gl.glVertex3f(topLeft, 1.0f, 0.0f);
gl.glTexCoord2f(1.0f, 0.0f); gl.glVertex3f(topRight, 1.0f, 0);
gl.glTexCoord2f(1.0f, 1.0f); gl.glVertex3f(bottomRight, -1.0f, 0);
gl.glTexCoord2f(0.0f, 1.0f); gl.glVertex3f(bottomLeft, -1.0f, 0.0f);

// gl.glRotated(180, 180, 0, 0); // doesn´t work

gl.glTexCoord2f(1.0f, 1.0f); gl.glVertex3f(topLeft, -1.0f, 0.0f);
gl.glTexCoord2f(0.0f, 1.0f); gl.glVertex3f(topRight, -1.0f, 0);
gl.glTexCoord2f(0.0f, 0.0f); gl.glVertex3f(bottomRight, -3.0f, 0);
gl.glTexCoord2f(1.0f, 0.0f); gl.glVertex3f(bottomLeft, -3.0f, 0.0f);```

Now the texture on the second quad is drawn upside-down, but how do I reverse the texture?

2. ## Re: Reverse quad - how?

Well you are using glRotate incorrectly for a start.
http://www.opengl.org/documentation/...gl/rotate.html
The first parameter is an angle (as you suspect), but the other values refer to x,y,z vectors.

Try gl.glRotated(180,0,0,1.0), and use two identical quads.

The other way, is what you seem to be trying, and that is to alter the Texture Coords, or vertex coords to affect your geometry. It's fairly trivial, and to flip or rotate textures you can simply swap x and y values in the texture coords. Altering the vertex coords will give you different results, but you may not understand them as it all depends on the "winding" of the polygon you make...

I would recommend you try and get hold of a copy of The Red Book and give it a thorough read. Or perhaps work through some of NeHe's tutorials on the web.

3. ## Re: Reverse quad - how?

EDIT: I solved it now. Thanks!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•