PDA

View Full Version : Scale texture



SaF
03-02-2001, 07:37 PM
Ok.. i want to scale a texture to its origin size on a quads.. not strech it..

I know how to use the u and v tex. coord. with the thing GL_REPEAT.. i tried few things like u/myTexture.width and v/myTexture.height...


please help me someone... or anyone or.. anything.. tk

SaF
03-04-2001, 09:03 AM
come on someone... i need to know http://www.opengl.org/discussion_boards/ubb/frown.gif

zed
03-04-2001, 10:58 AM
not sure if i unedrstand completely what u want but

glMatrixMode(GL_TEXTURE);
glScalef(2,2,2);
glMatrixMode(GL_MODELVIEW);

perhaps

Relic
03-06-2001, 12:43 AM
You want to display a textured quad so that the texture appears with the same number of pixels on screen as it has in the image?

One way to do this is:
Set texture coordinates to bottome left (0, 0), bottom right (1,0), top right (1, 1), and top left (0, 1).
Set the projection matrix to window size with gluOrtho2D, set modelview matrix to identity, and draw your quad in the size of the original texture image.


[This message has been edited by Relic (edited 03-06-2001).]