MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPUTER GRAPHICS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
To set the background color, the following command is used:
A
glClearColor(r, g, b, alpha)
B
glClear(GL ____ COLOR ____ BUFFER ____ BIT)
C
glBackColor(r, g, b)
D
glColor3f(r, g, b)
Explanation: 

Detailed explanation-1: -Most OpenGL programs redraw the entire scene (from a scene graph, which can be as simple as an array) when a change needs to take place. This makes changing the background color just using glClearColor (as Andrew Baldwin suggests) and then clearing and redrawing the scene as normal.

Detailed explanation-2: -The background of the OpenGL window should be blue. Colors in OpenGL are typically represented in RGB or RGBA mode. In RGB, a color is represented by a 3-tuple of real numbers in the range [0, 1]. These numbers represent the intensities of the red, green, and blue components of the color.

Detailed explanation-3: -glColor3f can be called in between glBegin and glEnd. When it is used this way, it can be used to give each vertex its own color. The resulting rectangle is then shaded with an attractive color gradient, as shown on the right.

Detailed explanation-4: -We use glColor function to set the foreground color, and glClearColor function to set the background (or clearing) color. Notes: Color is typically specified in float in the range 0.0f and 1.0f .

There is 1 question to complete.