• Home
  • Textbooks
  • Computer Graphics with Open GL
  • Attributes of Graphics Primitives

Computer Graphics with Open GL

Donald Hearn. M. Pauline. Baker, Warren R.Carithers

Chapter 4

Attributes of Graphics Primitives - all with Video Answers

Educators


Chapter Questions

01:30

Problem 1

Use the glutSetColor function to set up a color
table for an input set of color values.

Laura Skalaski
Laura Skalaski
Numerade Educator
01:37

Problem 2

Using vertex and color arrays, set up the description for a scene containing at least six twodimensional objects.

Nick Johnson
Nick Johnson
Numerade Educator
03:37

Problem 3

Write a program to display the two-dimensional
scene description in the previous exercise.

Grant Castaneda
Grant Castaneda
Numerade Educator
01:37

Problem 4

Using vertex and color arrays, set up the description for a scene containing at least four threedimensional objects.

Nick Johnson
Nick Johnson
Numerade Educator
03:03

Problem 5

Write a program to display a two-dimensional,
grayscale “target” scene, where the target is made
up of a small, filled central circle and two concentric rings around the circle spaced as far apart as
their thickness, which should be equal to the radius of the inner circle. The circle and rings are to
be described as point patterns on a white background. The rings/circle should ”fade in” from
their outer edges so that the inner portion of the
shape is darker than the outer portion. This can be
achieved by varying the sizes and inter-point spacing of the points that make up the rings/circle. For
example, the edges of a ring can be modeled with
small, widely spaced, light-gray points, while the
inner portion can be modeled with larger, more
closely spaced, dark-gray points.

Morgan Cheatham
Morgan Cheatham
Numerade Educator
04:17

Problem 6

Modify the program in the previous exercise to display the circle and rings in various shades of red
instead of gray

Ryan Pollard
Ryan Pollard
Numerade Educator
03:23

Problem 7

Modify the code segments in Section 7 for displaying data line plots, so that the line-width parameter is passed to procedure linePlot.

Jacquelyn Trost
Jacquelyn Trost
Numerade Educator
03:23

Problem 8

Modify the code segments in Section 7 for displaying data line plots, so that the line-style parameter is passed to procedure linePlot.

Jacquelyn Trost
Jacquelyn Trost
Numerade Educator
03:23

Problem 9

Complete the program in Section 7 for displaying
line plots using input values from a data file.

Jacquelyn Trost
Jacquelyn Trost
Numerade Educator
01:30

Problem 10

Complete the program in Section 7 for displaying line plots using input values from a data file. In
addition, the program should provide labeling for
the axes and the coordinates for the display area
on the screen. The data sets are to be scaled to fit
the coordinate range of the display window, and
each plotted line is to be displayed in a different
line style, width, and color.

Manisha Sarker
Manisha Sarker
Numerade Educator
14:49

Problem 11

Write a routine to display a bar graph in any specified screen area. Input is to include the data set, labeling for the coordinate axes, and the coordinates
for the screen area. The data set is to be scaled to fit
the designated screen area, and the bars are to be
displayed in designated colors or patterns.

Brian Ketelobeter
Brian Ketelobeter
Numerade Educator
02:22

Problem 12

Write a procedure to display two data sets defined
over the same x-coordinate range, with the data
values scaled to fit a specified region of the display
screen. The bars for one of the data sets are to be
displaced horizontally to produce an overlapping
bar pattern for easy comparison of the two sets of
data. Use a different color or a different fill pattern
for the two sets of bars.

Ashley Volpe
Ashley Volpe
Numerade Educator
01:40

Problem 13

Devise an algorithm for implementing a color
lookup table.

Carson Merrill
Carson Merrill
Numerade Educator
01:17

Problem 14

Suppose you have a system with an 10 inch by
14 inch video screen that can display 120 pixels per
inch. If a color lookup table with 256 positions is
used with this system, what is the smallest possible
size (in bytes) for the frame buffer?

Aaron Goree
Aaron Goree
Numerade Educator
04:55

Problem 15

Consider an RGB raster system that has a 1024-by786 frame buffer with 16 bits per pixel and a color
lookup table with 24 bits per pixel. (a) How many
distinct gray levels can be displayed with this system? (b) How many distinct colors (including gray
levels) can be displayed? (c) How many colors can
be displayed at any one time? (d) What is the total
memory size? (e) Explain two methods for reducing memory size while maintaining the same color
capabilities.

Stanley Enemuo
Stanley Enemuo
Numerade Educator
03:38

Problem 16

Write a program to output a grayscale scatter plot
of two data sets defined over the same x- and
y-coordinate ranges. Inputs to the program are the
two sets of data. The data sets are to be scaled to
fit within a defined coordinate range for a display
window. Each data set is to be plotted using points
in a distinct shade of gray

AN
Anjali Nagulpally
Numerade Educator
02:17

Problem 17

Modify the program in the previous exercise to
plot the two data sets in different colors instead of
shades of gray. Also, add a legend somewhere on
the plot bordered by a solid black line. The legend
should display the name of each data set (given
as input) in the color associated with that data
set.

Nicole Smina
Nicole Smina
Numerade Educator