Wednesday, March 7, 2012

[android-developers] Control colors in openGL

Hi,

Want to draw bars of different colors. The background(bitmap image)
for each bar is same but the foreground color needs to be different.

And also the color is to be filled on top of the bar just like a
progress bar. Here is my code snippet. Progress object share same
vertex buffer but a little smaller in horizontal direction. This
leaves some part of the rectangle filled with the color and then also
fills the background image with that color with a translucent effect.
can some one suggest what I'm doing wrong here

gl.glTranslatef(0.0f, 0.0f, -5.0f);
gl.glPushMatrix();
bar1.draw(gl); // Draw the bar
gl.glPopMatrix();

gl.glPushMatrix();
gl.glColor4f(0.7f, 0.7f, 0.0f, 1.0f);
progress1.draw(gl); //draw progress
gl.glPopMatrix();

gl.glTranslatef(0.0f, -0.80f, 0.0f);
gl.glPushMatrix();
bar1.draw(gl); // Draw the bar
gl.glPopMatrix();

gl.glPushMatrix();
gl.glColor4f(0.0f, 0.7f, 0.7f, 1.0f);
progress1.draw(gl); //draw progress
gl.glPopMatrix();

-Rikki

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate