Jump to content
  • Advertisement
Sign in to follow this  
David_naseef

OpenGL bumping effect

This topic is 3933 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!