PDA

View Full Version : Alternate texture method



bsperlin
10-18-2001, 06:21 AM
I have texture mapped a photo, read into a bitmap, onto a set of polygons by pairing each vertex with a texture coordinate. The calculations for this will slow down my app, so I was trying to make the following work. I understood that this code would put down a texture automatically, but it makes many small copies of the photo-texture instead of showing only one. Any ideas? Do I need to show more code?
Thanks,
Barry

glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR );
glTexGenfv( GL_S, GL_EYE_PLANE, xequalzero );
glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR );
glTexGenfv( GL_T, GL_EYE_PLANE, zequalzero );
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);

10-21-2001, 04:50 AM
Set the texture mode to clamp.
Giving the texture coordinates manually is the normal way to do it. You only have to do it once in your init code.