PDA

View Full Version : Texture mapping



alok47
01-23-2002, 12:59 AM
Can anyone pull me out from this mess ?

I want to specify texture coordinates using
glTexCoord*i ().

Since it doesn't maps linearly the integer values supplied to the float range [0, 1],
so I cannot access texture coordinates like
[0.5, 0.5].

It only specifies the extreme texture coordinates.

Is their any way by which I can specify different intermediate texels using the integer version of glTexCoordi ?

jide
01-23-2002, 01:01 AM
glTexCoord2f would be better i think

JD

alok47
01-23-2002, 03:34 AM
I can't use glTexCoord*f.

I have to use glTexCoord*i or glTexCoordPointer (GL_INT ) version.

Bob
01-23-2002, 04:02 AM
Just curious, why can't you use glTexCoord*f?

Anyways, scale the texture matrix so you can access parts of the texture with integer coordinates.




glMatrixMode(GL_TEXTURE);
glScalef(0.5, 0.5, 1);
glTexCoord2i(1, 1);

That glTexCoord2i call will be scaled to (0.5, 0.5).

kon
01-23-2002, 04:46 AM
Maybe he's using an integer only OpenGL version for platforms which can't perform floating point arithmetic?

kon