TRANSPARENCY AND MOUSE CONTROL PROBLEMS

I am trying to make an object transparent, though I don’t really know what to do here. Someone mentioned to me about the alpha level, but I don’t know what the standard variable for that is, or where to look on the program I am modifying.

Also, I was responsible for making the mouse useable on a program that was originally all controlled through the keyboard. The program is for viewing 3D objects. Basically, when the user clicks on the object, he can rotate it. For some reason, the mouse controls act differently with different 3D objects I view with the program. I don’t understand why.

I am trying to make an object transparent, though I don’t really know what to do here.
have you read the redbook?

i think the transparent object can be realized by modifying the transparency of the texture of every faces.

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=08

Maybe it can resolve your puzzle.

I enable blending, and with a texture with alpha channel, y use the next blend function

glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

I also put this in the init function.

glColor4ub((GLubyte)(1.0),(GLubyte)(1.0),(GLubyte)(1.0),(GLubyte)(0.5));
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

The original code used glColor3ub, I changed it to 4ub, and gave it an alpha value of 0.5.

After that, I also added this code below it:

glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);

Though, there isn’t any change. What am I doing wrong?

glColor4ub((GLubyte)(1.0),(GLubyte)(1.0),(GLubyte)(1.0),(GLubyte)(0.5));
this function takes unsigned bytes [0,255]. you are passing floats.

try glColor4ub(255,255,255,128);

only the floating point flavors take the normalized color components…

Ah I see. Thanks for the help!