Homework 1 CMPS160 Due Wednesday October 6th in class.  NAME:__________________


PLEASE NOTE: THIS IS A COMPUTER MOCK-UP OF THE HAND-DRAWN HANDOUT GIVEN IN CLASS. THIS IS FOR REFERENCE ONLY. NUMBERS UNDER RASTER SCREEN INDICATE COLUMNS, HOWEVER FONT DIFFERENCES HAVE MOVED THE FORMAT. COUNT FROM THE 0th COLUMN.

1. Consider a line from (2,3) to (4,9)

10 pts: a) Use the DDA method to plot pixel points.  Show all work.

      X   |  Y      

            |

            |

            |

            |

            |

            |

            |

            |

            |

            |

            |

                       

 

            Raster Screen

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

           0  1  2  3  4  5  6  7  8  9

 

 

 

20pts: a) Use the Bresenham algorithm to determine pixel points.  Show all work.

      K   |  PK     | X K+1   |  Y K+1           

_____________________

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

                       

 

            Plot on “Raster Screen”

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

           0  1  2  3  4  5  6  7  8  9

 

2. Consider a line from (3,1) to (9,5)

10 pts: a) Use the DDA method to plot pixel points.  Show all work.

      X   |  Y      

            |

            |

            |

            |

            |

            |

            |

            |

            |

            |

            |

 

                       

 

            Raster Screen

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

           0  1  2  3  4  5  6  7  8  9

 

 

 

20pts: a) Use the Bresenham algorithm to determine pixel points.  Show all work.

      K   |  PK     | X K+1   |  Y K+1           

_____________________

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

                       

 

            Plot on “Raster Screen”

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

           0  1  2  3  4  5  6  7  8  9

 

20pts: 3) Use the midpoint circle algorithm to plot pixels of a circle centered on (7,7) with a radius of 7.  Only compute as many values as needed before applying symmetry.  Show work.  Notate computed pixels versus symmetric pixels.

      K   |  PK     | X K+1   |  Y K+1           

_____________________

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |          

            |           |           |                      

            Plot on “Raster Screen”

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0 1  2  3  4  5  6  7  8  9 10 …       14

 

 

 

4. Given the following polyline, shade only the interior regions.  Show all work.

10 pts a) Use the odd-even rule.

 

 

 

 

 

 

 

 

 


10 pts b) Use the non-zero winding rule.