PDA

View Full Version : OpenGl Problem



Numan.pk
01-29-2013, 02:12 AM
hi dear all,

i have a problem about transparency in openGl, i have make a simple transparent baker in a texture room but the transparent color apply to all scenario.
please any body can help me that how can i apply the color only on baker.

the code of a cylindrical baker;

////baker//
glPushMatrix();
glEnable(GL_BLEND); // enable blending
// transparency blending function
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glShadeModel(GL_SMOOTH);


glDisable( GL_CULL_FACE );

glTranslatef(-1,-4,32);
glRotatef( -90.0, 1.0, 0.0, 0.0 );
glColor4f(0.8f, 0.9f, 0.7f, 0.7);
//glColor3f( 1.0, 0.2, 0.2 );
// Parameters: height, radius, slices, stacks
drawGluCylinder(3.3, 0.5, 15, 10 );
glPopMatrix();







Numan Ali
University of Malakand Pakistan

hlewin
01-29-2013, 02:31 AM
I'm not sure if I understand you right but are forgetting to call glDisable(GL_BLEND)?

Numan.pk
01-29-2013, 08:27 PM
Dear sir,
Guten Tag.

the problem solved.
thanx