Sign in to follow this  
Wizumwalt

OpenGL how to dimm some lines and make others appear brighter

Recommended Posts

In my OpenGL canvas I have a model being displayed and in the lower left corner I have a coordinate plane of x, y, and z ... that shows the direction of the model when I rotate it. What I'd like to do is ... when the model is zoomed in to where it takes up the entire screen, I want to somehow shade the elements of the model so that my coordinate planes appear brighter and don't get confused w/ the wiremesh of my model. What is this called so that I can read up on it somewheres and implement it.

Share this post


Link to post
Share on other sites
Are you rendering the wireframe with colors or textures? If you render it with colors, just set the wireframe model to a darker color, like this:
glColor3f(0.5, 0.5, 0.5);

If you render it with texture, you need to turn on texture blending mode to GL_MODULATE (if I recall correctly), and then do as above, to make the model darker.

But these two options make the ENTIRE model darker. If you only want part of it to get darker, try rendering as follows:

1. render the model
2. turn on alpha blending with GL_SRC_ALPHA, GL_SRC_ALPHA, and render a small black semi-transparent (alpha = 0.5) rectangle at the place where you will put the axes
3. finally render the axes in white on top of the alpha rectangle
This will make the model darker under where the axes are, but bright elsewhere.

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