I guess this example will clarify a bit for you.
#include <GL/freeglut.h>
void init()
{
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glClearColor(1.0, 1.0, 1.0, 1.0);
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glColor4f(0.5, 0.5, 0.5, 1.0);
glutSolidCube(0.5);
glTranslatef(-0.1, 0, 0);
glEnable(GL_BLEND);
glColor4f(1, 0, 0, 0.3);
glutSolidCube(0.4);
glDisable(GL_BLEND);
glFlush();
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGBA);
glutInitWindowSize(600,600);
glutInitWindowPosition(200,50);
glutCreateWindow("glut test");
glutDisplayFunc(display);
init();
glutMainLoop();
return 0;
}
Note that this example is very, very simplicist. So, its main purpose is just to demostrate how to use BLEND functions. I did not take care about DEPTH removal or camera position.
I used the program posted here (How to use alpha transparency in OpenGL?) to construct this one.