guju
08-20-2002, 05:46 AM
Hi There!
I create a 1d texture as follows:
glGenTextures(1,&texResult);
glBindTexture( GL_TEXTURE_1D,texResult);
glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, stripeImageWidth, 0, GL_RGBA, GL_FLOAT,stripeImage);// the stripeImage is filled from 0. to 1.
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glTexParameteri(GL_TEXTURE_1D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_1D,GL_TEXTURE_MAG_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_1D,GL_TEXTURE_WRAP_S,GL _CLAMP);
In my repaint i make the following:
glEnable(GL_TEXTURE_1D);
glBindTexture( GL_TEXTURE_1D, texResult );
glEnableClientState (GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(1, GL_FLOAT, 0, result_damage);
ShowModelAsList();// Display the DisplayList
But i only get the model with one color, but the entries in result_damage are beween 0. and 0.8.
What could be wrong
Thanks
Juergen
I create a 1d texture as follows:
glGenTextures(1,&texResult);
glBindTexture( GL_TEXTURE_1D,texResult);
glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, stripeImageWidth, 0, GL_RGBA, GL_FLOAT,stripeImage);// the stripeImage is filled from 0. to 1.
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glTexParameteri(GL_TEXTURE_1D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_1D,GL_TEXTURE_MAG_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_1D,GL_TEXTURE_WRAP_S,GL _CLAMP);
In my repaint i make the following:
glEnable(GL_TEXTURE_1D);
glBindTexture( GL_TEXTURE_1D, texResult );
glEnableClientState (GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(1, GL_FLOAT, 0, result_damage);
ShowModelAsList();// Display the DisplayList
But i only get the model with one color, but the entries in result_damage are beween 0. and 0.8.
What could be wrong
Thanks
Juergen