PDA

View Full Version : blending



fox
01-18-2001, 11:42 PM
Hi I'm using blending to to obtain the intersection of some pyramids - it's working but from the side and top view the sides of the pyramid appear opaque. I've tried back-face culling which gets rid of the problem it does only show the intersection area as opaque but then when you rotate you can't see the pyramids - the code is below

glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glDepthMask(GL_FALSE);
glBlendFunc(GL_ONE, GL_SRC_COLOR);
glLightfv(GL_LIGHT0, GL_DIFFUSE, BlueLight);
glLightfv(GL_LIGHT0, GL_POSITION, BluePos);
glTranslatef(0.0, 0.0, 0.5);
glRotated(45, 0.0, 0.0, 1.0);
glMaterialfv(GL_FRONT, GL_DIFFUSE, DiffuseRef);
glMaterialfv(GL_FRONT, GL_SPECULAR, SpecularRef);
glMaterialfv(GL_FRONT, GL_SHININESS, ShininessHigh);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, PyramidSurface);
gluCylinder(PyramidVolume, 0.025, (8.5-0.5), (1.4*8.5), 4.0, 1.0);
glDepthMask(GL_TRUE);
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);

-any ideas how I can sort this out? - if i just wanted to see the intersected area - how could do this

thanx