Alright, I'm working on checkers in opengl. The user will use the arrow keys to move a cursor around the board to select and move the pieces. I want the cursor to be blue at the bottom, and slowly move up to be completely transparent
http://files.gtanet.com/gtasa/walkth...ssantos043.jpg
Here is a mediocre example of the effect i am aiming for, but I am having trouble with Blending.
my call to glBlendfunc:
and when i draw the cursor:Code:glBlendFunc(GL_SRC_ALPHA,GL_ONE);
and the results:Code:glEnable(GL_BLEND);
glBegin(GL_QUADS);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f);
glColor4f(1.0f, 1.0f, 1.0f, 0.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
glColor4f(1.0f, 1.0f, 1.0f, 0.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f); glVertex3f(-1.0f, -1.0f, -1.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f); glVertex3f( 1.0f, -1.0f, -1.0f);
glColor4f(1.0f, 1.0f, 1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f);
glColor4f(1.0f, 1.0f, 1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f); glVertex3f( 1.0f, -1.0f, -1.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f);
glColor4f(1.0f, 1.0f, 1.0f, 0.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
glColor4f(1.0f, 1.0f, 1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f); glVertex3f(-1.0f, -1.0f, -1.0f);
glColor4f(1.0f, 1.0f, 1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
glColor4f(1.0f, 1.0f, 1.0f, 0.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f);
glEnd();
glDisable(GL_BLEND);
http://img455.imageshack.us/img455/5669/ck1jy.png
hopefully you can see what is going on in that picture
How can i get the effect i want? :confused:
