Header Banner
WonderHowTo Logo
WonderHowTo
C++
wonderhowto.mark.png
Gadget Hacks Next Reality Food Hacks Null Byte The Secret Yumiverse Invisiverse Macgyverisms Mind Hacks Mad Science Lock Picking Driverless
Home
C++

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

"How to Add colors to 3D scenes with OpenGL for C++" cover image

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.

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

Click through to watch this video on videotutorialsrock.com

External Content
www.videotutorialsrock.com

Apple's iOS 26 and iPadOS 26 updates are packed with new features, and you can try them before almost everyone else. First, check Gadget Hacks' list of supported iPhone and iPad models, then follow the step-by-step guide to install the iOS/iPadOS 26 beta — no paid developer account required.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!