How To: Add colors to 3D scenes with OpenGL for C++

Add colors to 3D scenes with OpenGL for C++

After you've learned the basics about shapes, transformations, and times, it's time to move onto learning the color scheme of things in the C++ programming language. You can't have a beautiful 3D game or program with out vibrant colors! This video lesson will show you how to add colors to 3D scenes with OpenGL for C++, so you can start making your own 3D programs.

Learn how to add color to 3D polygons and to the background. First, add glEnable(GL_COLOR_MATERIAL) to the end of initRendering, in order to enable colors. Then watch the rest to see how it's done, or click on one of the below links.

You're just going to add two calls to glColor3f. Whenever we call glColor3f, we change the current color to the indicated RGB color. Everything we draw afterwards is drawn using the new current color.

*Get the text version of this lesson.
*Download the source code.
*Try out the exercises.

Check out the other videos in this video series.

Add colors to 3D scenes with OpenGL for C++

Add colors to 3D scenes with OpenGL for C++ Click through to watch this video on videotutorialsrock.com

Just updated your iPhone? You'll find new emoji, enhanced security, podcast transcripts, Apple Cash virtual numbers, and other useful features. There are even new additions hidden within Safari. Find out what's new and changed on your iPhone with the iOS 17.4 update.

Be the First to Comment

Share Your Thoughts

  • Hot
  • Latest