• Home
  • Textbooks
  • Computer Graphics with Open GL
  • Implementation Algorithms for Graphics Primitives and Attributes

Computer Graphics with Open GL

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

Chapter 5

Implementation Algorithms for Graphics Primitives and Attributes - all with Video Answers

Educators


Chapter Questions

01:57

Problem 1

Implement a polyline function using the DDA algorithm, given any number $(n)$ of input points. A single point is to be plotted when $n=1$.

WZ
Wen Zheng
Numerade Educator
01:42

Problem 2

Extend Bresenham's line algorithm to generate lines with any slope, taking symmetry between quadrants into account.

William Semus
William Semus
Numerade Educator
01:57

Problem 3

Implement a polyline function, using the algorithm from the previous exercise, to display the set of straight lines connecting a list of $n$ input points. For $n=1$, the routine displays a single point.

WZ
Wen Zheng
Numerade Educator
04:54

Problem 4

Use the midpoint method to derive decision parameters for generating points along a straightline path with slope in the range $0<m<1$. Show that the midpoint decision parameters are the same as those in the Bresenham line algorithm.

Sheryl Ezze
Sheryl Ezze
Numerade Educator
00:56

Problem 5

Use the midpoint method to derive decision parameters that can be used to generate straightline segments with any slope.

Jay Patel
Jay Patel
Numerade Educator
00:30

Problem 6

Set up a parallel version of Bresenham's line algorithm for slopes in the range $0<m<1$.

Karla Conrey
Karla Conrey
Numerade Educator
01:42

Problem 7

Set up a parallel version of Bresenham's algorithm for straight lines with any slope.

William Semus
William Semus
Numerade Educator
03:55

Problem 8

Suppose you have a system with an 8 inch by 10 inch video monitor that can display 100 pixels per inch. If memory is organized in one byte words, the starting frame buffer address is 0 , and each pixel is assigned one byte of storage, what is the frame buffer address of the pixel with screen coordinates $(x, y)$ ?

Aaron Goree
Aaron Goree
Numerade Educator
03:55

Problem 9

Suppose you have a system with a 12 inch by 14 inch video monitor that can display $120 \mathrm{pix}-$ els per inch. If memory is organized in one byte words, the starting frame buffer address is 0 , and each pixel is assigned one byte of storage, what is the frame buffer address of the pixel with screen coordinates $(x, y)$ ?

Aaron Goree
Aaron Goree
Numerade Educator
03:55

Problem 10

Suppose you have a system with a 12 inch by 14 inch video monitor that can display 120 pixels per inch. If memory is organized in one byte words, the starting frame buffer address is 0 , and each pixel is assigned 4 bits of storage, what is the frame buffer address of the pixel with screen coordinates $(x, y) ?$

Aaron Goree
Aaron Goree
Numerade Educator
05:22

Problem 11

Incorporate the iterative techniques for calculating frame-buffer addresses (Section 3 ) into the Bresenham line algorithm.

Chris Trentman
Chris Trentman
Numerade Educator
03:35

Problem 12

Revise the midpoint circle algorithm to display circles with input geometric magnitudes preserved (Section 8).

Numerade Educator
Numerade Educator
Numerade Educator
03:03

Problem 13

Set up a procedure for a parallel implementation of the midpoint circle algorithm.

Morgan Cheatham
Morgan Cheatham
Numerade Educator
01:44

Problem 14

Derive decision parameters for the midpoint ellipse algorithm assuming the start position is $\left(r_{x}, 0\right)$ and points are to be generated along the curve path in counterclockwise order.

Michael Jacobsen
Michael Jacobsen
Numerade Educator
04:08

Problem 15

Set up a procedure for a parallel implementation of the midpoint ellipse algorithm.

John Peter
John Peter
Numerade Educator
05:18

Problem 16

Devise an efficient algorithm that takes advantage of symmetry properties to display a sine function over one cycle.

WZ
Wen Zheng
Numerade Educator
05:18

Problem 17

Devise an efficient algorithm that takes advantage of symmetry properties to display a sine function over one cycle.

WZ
Wen Zheng
Numerade Educator
03:05

Problem 18

Devise an efficient algorithm, taking function symmetry into account, to display a plot of damped harmonic motion:
$$
y=A e^{-k x} \sin (\omega x+\theta)
$$
where $\omega$ is the angular frequency and $\theta$ is the phase of the sine function. Plot $y$ as a function of $x$ for several cycles of the sine function or until the maximum amplitude is reduced to $\frac{A}{10}$.

James Kiss
James Kiss
Numerade Educator
01:10

Problem 19

Use the algorithm developed in the previous exercise to write a program that displays one cycle of a sine curve. The curve should begin at the left edge of the display window and complete at the right edge, and the amplitude should be scaled so that the maximum and minimum values of the curve are equal to the maximum and minimum $y$ values of the display window.

Suzanne W.
Suzanne W.
Numerade Educator
09:30

Problem 20

Using the midpoint method, and taking symmetry into account, develop an efficient algorithm for scan conversion of the following curve over the interval $-10 \leq x \leq 10$.

Alvar Garcia-Fernandez
Alvar Garcia-Fernandez
Numerade Educator
01:10

Problem 21

Use the algorithm developed in the previous exercise to write a program that displays a portion of a sine curve determined by an input angular interval. The curve should begin at the left edge of the display window and complete at the right edge, and the amplitude should be scaled so that the maximum and minimum values of the curve are equal to the maximum and minimum $y$ values of the display window.

Suzanne W.
Suzanne W.
Numerade Educator
02:45

Problem 22

Use the midpoint method and symmetry considerations to scan convert the parabola

Suman Saurav Thakur
Suman Saurav Thakur
Numerade Educator
02:45

Problem 23

Use the midpoint method and symmetry considerations to scan convert the parabola

Suman Saurav Thakur
Suman Saurav Thakur
Numerade Educator
01:21

Problem 24

over the interval $-5 \leq x \leq 5$.
4 Set up a midpoint algorithm, taking symmetry considerations into account to scan convert any

Taylor Shimono
Taylor Shimono
Numerade Educator
01:25

Problem 25

Define an efficient polygon-mesh representation for a cylinder and justify your choice of representation.

Christopher Stanley
Christopher Stanley
Numerade Educator
01:14

Problem 26

Write a routine to implement scaling as a raster transformation of a pixel block.

Adriano Chikande
Adriano Chikande
Numerade Educator
22:52

Problem 27

Write a program to display an animation of a black square on a white background tracing a circular, clockwise path around the display window with the path's center at the display window's center (like the tip of the minute hand on a clock). The orientation of the square should not change. Use only basic OpenGL geometric transformations to do this.

Brian Ketelobeter
Brian Ketelobeter
Numerade Educator
02:19

Problem 28

Repeat the previous exercise using OpenGL matrix operations.

Adriano Chikande
Adriano Chikande
Numerade Educator
07:35

Problem 29

Modify the program in Exercise 27 to have the square rotate clockwise about its own center as it moves along its path. The square should complete one revolution about its center for each quarter of its path around the window that it completes. Use only basic OpenGL geometric transformations to do this.

Christine Anacker
Christine Anacker
Numerade Educator
02:19

Problem 30

Repeat the previous exercise using OpenGL matrix operations.

Adriano Chikande
Adriano Chikande
Numerade Educator
02:51

Problem 31

Modify the program in Exercise 29 to have the square additionally "pulse" as it moves along its path. That is, for every revolution about its own center that it makes, it should go through one pulse cycle that begins with the square at full size, reduces smoothly in size down to 50 normal size by the end of the cycle. Do this using only basic OpenGL geometric transformations.

Aaron Goree
Aaron Goree
Numerade Educator
11:45

Problem 32

Repeat the previous exercise using only OpenGL matrix operations.

Sirat Shah
Sirat Shah
Numerade Educator
00:26

Problem 33

Modify the program in the previous exercise to plot the three data sets in different colors, as well as different line styles.

Pammi Eswari
Pammi Eswari
Numerade Educator
16:39

Problem 34

Set up an algorithm for displaying thick lines with butt caps, round caps, or projecting square caps. These options can be provided in an option menu.

Brian Ketelobeter
Brian Ketelobeter
Numerade Educator
04:21

Problem 35

Devise an algorithm for displaying thick polylines with a miter join, a round join, or a bevel join. These options can be provided in an option menu.

Willis James
Willis James
Numerade Educator
16:39

Problem 36

Implement pen and brush menu options for a linedrawing procedure, including at least two options: round and square shapes.

Brian Ketelobeter
Brian Ketelobeter
Numerade Educator
02:57

Problem 37

Modify a line-drawing algorithm so that the intensity of the output line is set according to its slope. That is, by adjusting pixel intensities according to the value of the slope, all lines are displayed with the same intensity per unit length.

Heather Zimmers
Heather Zimmers
Numerade Educator
01:42

Problem 38

Define and implement a function for controlling the line style (solid, dashed, dotted) of displayed ellipses.

William Semus
William Semus
Numerade Educator
01:26

Problem 39

Define and implement a function for setting the width of displayed ellipses.

Grace Bajar
Grace Bajar
Numerade Educator
02:16

Problem 40

Modify the scan-line algorithm to apply any specified rectangular fill pattern to a polygon interior, starting from a designated pattern position.

Amber Leann
Amber Leann
Numerade Educator
01:54

Problem 41

Write a program to scan convert the interior of a specified ellipse into a solid color.

Joshua Eastwood
Joshua Eastwood
Numerade Educator
01:05

Problem 42

Write a procedure to fill the interior of a given ellipse with a specified pattern.

Kimberly Waterbury
Kimberly Waterbury
Numerade Educator
02:05

Problem 43

Write a procedure for filling the interior of any specified set of fill-area vertices, including one with crossing edges, using the nonzero winding number rule to identify interior regions.

Heather Zimmers
Heather Zimmers
Numerade Educator
04:05

Problem 44

Modify the boundary-fill algorithm for a 4-connected region to avoid excessive stacking by incorporating scan-line methods.

Gregory Higby
Gregory Higby
Numerade Educator
02:43

Problem 45

Write a boundary-fill procedure to fill an 8-connected region.

Shawn Gedert
Shawn Gedert
Numerade Educator
01:44

Problem 46

Explain how an ellipse displayed with the midpoint method could be properly filled with a boundary-fill algorithm.

Michael Jacobsen
Michael Jacobsen
Numerade Educator
02:13

Problem 47

Develop and implement a flood-fill algorithm to fill the interior of any specified area.

Linda Hand
Linda Hand
Numerade Educator
04:38

Problem 48

Define and implement a procedure for changing the size of an existing rectangular fill pattern.

Aman Gupta
Aman Gupta
Numerade Educator
01:40

Problem 49

Write a procedure to implement a soft-fill algorithm. Carefully define what the soft-fill algorithm is to accomplish and how colors are to be combined.

Carson Merrill
Carson Merrill
Numerade Educator
00:38

Problem 50

Devise an algorithm for adjusting the height and width of characters defined as rectangular grid patterns.

Ashley High
Ashley High
Numerade Educator
03:14

Problem 51

Implement routines for setting the character up vector and the text path for controlling the display of character strings.

Harriet O'Brien
Harriet O'Brien
Numerade Educator
04:13

Problem 52

Write a program to align text as specified by input values for the alignment parameters.

Morgan Cheatham
Morgan Cheatham
Numerade Educator
00:38

Problem 53

Develop procedures for implementing marker attributes (size and color).

Darshan Maheshwari
Darshan Maheshwari
Numerade Educator
01:42

Problem 54

Implement an antialiasing procedure by extending Bresenham's line algorithm to adjust pixel intensities in the vicinity of a line path.

William Semus
William Semus
Numerade Educator
01:32

Problem 55

Implement an antialiasing procedure for the midpoint line algorithm.

Charles Carter
Charles Carter
Numerade Educator
01:57

Problem 56

Develop an algorithm for antialiasing elliptical boundaries.

WZ
Wen Zheng
Numerade Educator
02:34

Problem 57

Modify the scan-line algorithm for area fill to incorporate antialiasing. Use coherence techniques to reduce calculations on successive scan lines.

Sriram Soundarrajan
Sriram Soundarrajan
Numerade Educator
06:22

Problem 58

Write a program to implement the PittewayWatkinson antialiasing algorithm as a scan-line procedure to fill a polygon interior, using the OpenGL point-plotting function.

Aatish Gupta
Aatish Gupta
Numerade Educator