Sign in to follow this  
David_naseef

OpenGL bumping effect

Recommended Posts

Hi Guys, I am drawing a simple pushbutton in opengl. It is only a white border rectangle with a yello fill. My question is how could I make the effect of a bumping pushbutton by playing with the white border. Should I play with the thickness or with color blending of the border or something else. I haven't done this before. Thanks!

Share this post


Link to post
Share on other sites
I think this is more of an art-related question than a programming one.

How are you drawing the button? Using colored quads? Using a texture?

One way would be to color the bottom and left borders of the button a little darker than the right and top when the button is in a normal state. i.e. the bottom and left would be a light gray and the top and right would be white.

When the button is in a pushed state, just switch the dark and light, so that the right and top are darker. Additionally, you should also darken the yellow fill a little when the button is pushed in.

This should give you the desired affect. Naturally this could be achieved in several ways, such as changing the colors in OpenGL or swapping out textures.

There is a lot more you could do, such as using 4 colors around the border rather than two, but I'll leave that to you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this