PDA

View Full Version : texture generation



unknown
02-17-2001, 09:14 AM
Hi!

I have a question about the texture generation functions in opengl.
If I wan't to texture a quad with the full texture i do like this:
float s_Vector[4] = { 1, 0, 0, 0 };
float t_Vector[4] = { 0, 0, 1, 0 };

glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
glTexGenfv( GL_S, GL_OBJECT_PLANE, s_Vector );

glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
glTexGenfv( GL_T, GL_OBJECT_PLANE, t_Vector );

But how do I do if I only want to use the texture from 0.7 to 1.0. Is there some way to tell opengl that I wan't to map the texture from one coord to another.

Thanks
Kristian

Michael Steinberg
02-17-2001, 01:17 PM
In case you don't know, you can manually specify a texcoord for every vertex with glTexCoord*().