Hei!
im doing an JOGL CaveFlyer…
WebStart - Click to watch my demo.
my game will hold an caveship looming around on caves, ship is an “gl_quad”…
my current routines are below, what i am doing wrong, i dont seem to know how to use the “glBlendColor” at the right way to change my ships color and transparency values…
i also have the following problem…
if you change the frame size on my demo with PageUp / PageDown keys, why is blending setting my entire screen transparent when frame size is small ??
i have my glBlendFunc set only to gl.glBlendFunc ( GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA ); do i also need to set GL_DEST_ALPHA or GL_SRC/DEST_COLOR ??
thanks…
gl.glBlendFunc ( GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA ); // is my glBlendFunc set correctly for an texture holding transparent color ??
gl.glBlendColor ( 1f,0f,0f,0.5f ); // this should set my ship to red and half transparent, but, nothing happens ?? why ??
cG.ctextalus.enable ();
cG.ctextalus.bind ();
gl.glBegin(GL.GL_QUADS);
gl.glTexCoord2f((float)( coords.left() ), (float)( coords.top() ) );
gl.glVertex3f(-0.0016f, +0.0016f, 0.0f); // Top Left
gl.glTexCoord2f((float)( coords.right() ), (float)( coords.top() ) );
gl.glVertex3f(+0.0016f, +0.0016f, 0.0f); // Top Right
gl.glTexCoord2f((float)( coords.right() ), (float)( coords.bottom() ) );
gl.glVertex3f(+0.0016f, -0.0016f, 0.0f); // Bottom Right
gl.glTexCoord2f((float)( coords.left() ), (float)( coords.bottom() ) );
gl.glVertex3f(-0.0016f, -0.0016f, 0.0f); // Bottom Left
gl.glEnd();
cG.ctextalus.disable ();
JariTapio / Helsinki
www.EuroJari.net
JariTapio@EuroJari.net