Jump to content
  • Advertisement
Sign in to follow this  
Wizumwalt

OpenGL how to dimm some lines and make others appear brighter

This topic is 3931 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

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

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!