Interactive Computer Graphics: A Top-Down Approach Using OpenGL (4th Edition)

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS/ECE 433 Introduction to Computer Graphics, Fall 2007 Homework 2 Due Sunday, October 7, 2007 at 11:59pm In this homework, you will get to experiment with the 2D and 3D transformations we have been talking about in class. 1. Experimentation with 2D Transformations (30 pts) In this portion of the assignment, you will write code that will allow you to apply a series of 2D transformations to the 2D model of a house. First, you will begin by writing a Matrix3x3 class that allows you to express rotations, translations, scales and shears in 2D as we discussed in class. Specifically you must: 1. Create a “*” operator that allows you to multiply the matrix by a vector of class Vector2D and returns a new vector 2. Create a “*” operator that allows you to multiply the matrix by another matrix and return a new matrix 3. Create an “=” operator that allows you to set the matrix to a set of new values 4. Create an identity method that sets the matrix to the identity matrix 5. Create methods to specify various transformations using the matrix. In particular, you will have to implement the matrices for translations, rotations, scaling, and shears. 6. For debugging, add a print() method that prints out the values of the matrix Once this has been done, you can verify that your matrix class works by creating matrices to transform the vertices of the house. To do this, multiply the vertices by the transformation matrix in the draw loop and the house should appear transformed in the result.
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern