PDA

View Full Version : glTexGen*() ????????



SaF
03-09-2001, 09:12 PM
How do I use glTexGen*() function

Thank

Leyder Dylan
03-10-2001, 02:20 AM
Hi,

Lesson 6 on NeHe site.
http://nehe.gamedev.net

SaF
03-10-2001, 06:15 AM
Salut Leyder Dylan

je c comment appliquer des textures pis toute le kit..... je veux savoir comment utiliser la function glTexGen*() qui sert a generer les coordonner de la texture en passant..

tk


anyone else???

Deiussum
03-10-2001, 06:21 AM
What's the problem you're having with it. It's a straight forward function. You give it 2 paramaters. The first is the number of textures you want it to generate IDs for, the second is a pointer (You do understand pointers, right? If not better get more into C/C++ before you start OpenGL.) to an unsigned int array (or single value if you only need 1). It fills in the array (single value) with a texture ID that is not in use.

SaF
03-10-2001, 07:19 AM
glTexGenf() doesnt accept pointer??.. http://www.eecs.tulane.edu/www/graphics/doc/OpenGL-Man-Pages/glTexGen.html

I use it like that:

glEnable(GL_TEXTURE_GEN_S);
glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);

How do I get the coord back??

Deiussum
03-10-2001, 08:00 PM
Doh! I feel like a complete idiot now. I was thinking glGenTextures... (Well... switch around Tex & Gen and get rid of the 'ures' and they are almost the same.) http://www.opengl.org/discussion_boards/ubb/smile.gif

You can also use glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);

To generate coordinates for environment mapping.

Deiussum
03-11-2001, 08:10 AM
You won't actually get the coordinates back. OpenGL will automatically generate them for you without having to use the glTexCoord functions. I'm not sure if there is anyway to get them back. If you need the coordinates, you'll probably have to generate them yourself.

SaF
03-11-2001, 02:54 PM
Thank Deiussum http://www.opengl.org/discussion_boards/ubb/smile.gif