PDA

View Full Version : Wrong direction



abhiboy007
07-30-2001, 06:26 AM
i created a sphere and and was able to map a world texture on it. but texture i have pasted is not positioned properly.
for eg.
texture on sphere must be like this


1.0 1,1

0,0 0,1

but on sphere it is like this,


1,1 0,1

1,0 0,0

what should i do ?

Coconut
07-30-2001, 08:35 AM
You can use texture matrix to flip or rotate.

abhiboy007
07-31-2001, 05:43 AM
how ?

Coconut
07-31-2001, 06:14 AM
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glRotatef(90.0f, 0.0f, 0.0f, 1.0f); //to rotate by 90 degrees
glScalef(-1.0f, 1.0f, 1.0f); //to flip horizontally
....
....
glMatrixMode(GL_MODELVIEW); //back to model view