Quiz 2
List the 2 arguments of the getClear() function (type – should have been
glClear())
Depth Buffer, Color Buffer
Define ambient light in detail
The ambient component is the light from that source that's been scattered so much by the environment that its direction is impossible to determine - it seems to come from all directions. Backlighting in a room has a large ambient component, since most of the light that reaches your eye has bounced off many surfaces first. A spotlight outdoors has a tiny ambient component; most of the light travels in the same direction, and since you're outdoors, very little of the light reaches your eye after bouncing off other objects. When ambient light strikes a surface, it's scattered equally in all directions.
Define diffuse light in detail
Diffuse light comes from one direction, so it's brighter if it comes squarely down on a surface than if it barely glances off the surface. Once it hits a surface, however, it's scattered equally in all directions, so it appears equally bright, no matter where the eye is located. Any light coming from a particular position or direction probably has a diffuse component.
Define
emissive light in detail
Materials may have an emissive color, which simulates light originating from an object. The emissive color of a surface adds intensity to the object, but is unaffected by any light sources. Also, the emissive color does not introduce any additional light into the overall scene.
Explain the difference between methods for treating RGB for light versus for
materials
For light, the numbers correspond to a percentage of full intensity for each color. For materials, the numbers correspond to the reflected proportions of those colors.
List the steps followed for adding light to a scene
Define normal vectors for each vertex of every object.
Create, select, and position one or more light sources.
Create and select a lighting model
Define material properties for the objects in the scene.
The function glLight () takes 3 parameters. List and describe each.
Light: identifies the light source.
Pname: defines the characteristic of the light being set.
Param: indicates the values to which pname characteristic is set
Give code that will set the last parameter in the function glLight()
light_ambient [] = {0.0, 0.0, 0.0, 1.0}
Describe a directional light source and give an example.
One that is located infinitely far away from the scene. The effect of an infinite location is that the rays of light can be considered parallel by the time they reach an object.
An example is the sun.
Describe a positional light source and give an example.
A light source that is nearer to the scene; its exact position within the scene determines the effect it has on a scene, and, specifically, the direction from which the light rays come.
An example is a desk lamp.
What must you do in order to have a positional light source act like a
spotlight?
Restrict the shape of the light it emits to a cone. Use the GL_SPOT_CUTOFF parameter. The angle of the cone at the apex is twice this parameter. By default this parameter is 180 or all degrees.
List the options for controlling a light’s position and direction
Keeping the light stationary
Independently moving the light
Moving the light source together with the viewpoint
List the components of the lighting model
The global ambient light intensity
Whether the viewpoint position is local to the scene or should be considered to be an infinite distance away.
Whether lighting calculations should be performed differently for both the front and back faces of objects.
Whether the specular color should be separated from ambient and diffuse colors and applied after the texturing operation.
Code
In the space following each line of code below, explain what the line of code does. Use the back if necessary and indicate that line is being addressed. Explain what the function does and the meaning of any parameters. Note that not all functions are provided.
void init(void)
{
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
Sets the effect that the material has on reflected light. Numbers are red, green,
blue, and alpha. Float means the numbers have decimals.
GLfloat mat_shininess[] = { 50.0 };
Controls the size and brightness of the highlight. Can assign numbers in range 0.0 to
128.0. The higher the number, the smaller and brighter (more focused) the highlight.
glShadeModel (GL_SMOOTH);
Sets the shading model, parameters can be GL_SMOOTH or GL_FLAT
}
void display(void)
{
glutSolidSphere (1.0, 20, 16);
Draws a solid sphere with radius 1.0, 20 slices, and 16 stacks.
glFlush ();
Forces previously issued OpenGL commands to start executing.
}
What does ENIAC stand for?
Electronic Numerical Integrator and Computer
What was the first commercial
computer?
Univac
The ENIAC used a Williams Tube.
What was it for.
Memory – it was the first practical random access memory.