i know that this question pops up numerous times, but i really am stumped.
i have a method that draws a chain (3 torii). i need it to be drawn both opaque and translucent. this chain moves around, and i wanted to draw the beginning and ending states of my animation translucent, while the current frame of where the chain is is drawn opaque.
so my paintGL is essentially (half pseudocode)
paintGL()
{
drawChain();
drawTranslucentChain( beginningTime );
drawTranslucentChain( endTime );
}
drawChain()
{
uses only Color3f() statements
}
drawTranslucentChain()
{
glPushAttrib( GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT );
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
// set alpha bit
glColor4d( 0., 0., 0., 0.1 );
glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE );
drawChain();
glPopAttrib();
}
for some reason, though, the ending and beginning chains are drawn FULL alpha! why is this, even though the ColorMask is turned on?
Much thanks,
Jon