You are here:

C++/grphics via OpenGL


sir i have made a room using GlutWireCube();.it is looking i want to paint its walls using texture mapping using red color.give me a code to do this.and give a idea of walk through in a room.
waiting for response.

Hello naveed, thank you for the question.

Now that you have your room, you want to color its walls. This shouldn't be too hard.

I'm not too familiar with glut like I am with native OpenGL, but I'm sure if there is a function to create a cube there is a way to access each side of it. Once you access each side just call: glColor3f(1.0f, 0.0f, 0.0f). OpenGL color methods take parameters in the RGB form, with 0, 0, 0 being completely dark and 1, 1, 1 being completely white.

If there is no access method, you can do it the old fashioned way:

// set up the rest of the vertices
// glVertex3f()
// set the color of each
// glColor3f(1.0f, 0.0f, 0.0f)

Let me know how this works out.

If you have any other questions, please do not hesistate to ask.

- Eddie


All Answers

Answers by Expert:

Ask Experts




I can answer questions about the C++ language, object oriented design and architecture. I am knowledgable in a lot of the math that goes into programming, and am certified by I also know a good deal about graphics via OpenGL, and GUIs.


I have completed numerous games and demos created with the C++ programming language. Currently employed as a software engineer in the modeling and simulation field. I have about 7 years experience.

©2017 All rights reserved.