Camera Class

Lab Image
Today's goal: Implement a camera class, and get refreshed on the different matrices.

Your Task(s)

  1. Half Lecture with Mike: Slides
  2. Find your partner in the spreadsheet here. It is your responsibility for the two of you to complete the lab by the beginning of the next lab
    • Note: If your partner is missing, you will be reassigned, and your partner will have to complete the lab individually.
    • Note: If you know you will miss class, arrange to have your lab checked off before the next lab is out!
  3. Download the files given in the next section titled "Files Given/Starter Code".
  4. Complete the "Code Review" Section
  5. Complete the "C++ Refresh" section
  6. (Optional) Complete any optional "Going Further" suggested tasks.

Files Provided/Starter Code

  • Clicking the following link gives you immediate access to your personal private github repository.
    • You may use your personal or Northeastern github account. I do not care, but please be consistent with what you choose.
    • I do look at your repositories, make sure you commit and push your final changes to repositories!
    • Please do not click until class starts. Occasionally I make changes until a few minutes before class (usually spelling corrections and other small typos).
    • Click now to get the lab starter code: Github Repository

Camera Class

A good camera can make or break a 3D scene. Today we are going to implement a very simple one! See the half-lecture for more details.

C++ Refresh

While this is not a C++ course, each lab I am going to provide an additional C++ code snippet so you can get up to speed (or perhaps just learn something cool and relevant to the course).
  • Code Sample 1
  • Type out(i.e. DO NOT just copy and paste) the file so you learn the commands. Then save it with an appropriate name (e.g. example.cpp)
  • Compile and run with the following on the terminal:
    • Linux Option 1: clang++ -std=c++14 example.cpp -o example
    • Linux Option 2: g++ -std=c++14 example.cpp -o example
    • Mac Option 1:   clang++ -std=c++14 example.cpp -o example
    • Mac Option 2:   g++ -std=c++14 example.cpp -o example
    • Mac Option 3:   Create a console-based XCode project
    • Windows Option 1: Create a console-based Visual Studio C++ project
  • Finally, add this C++ code snippet to your repository to practice working with git.

Going Further

What is that, you finished Early? Did you enjoy this lab? Here are some (optional) ways to further this assignment.
  • Try to make your camera move smoothly!
  • Implement a 'jump' operation


  • You and your partner will receive the same grade from a scale of 0-2.
    • 0 for no work completed.
    • 1 for some work completed, but something is not working properly
    • 2 for a completed assignment (with possible 'going further' options completed)
  • You must complete this lab by next class. You will run your lab in front of me at the start of the next lab when class starts.

More Resources

Some additional resources to help you through this lab assignment

Found a bug?

If you found a mistake (big or small, including spelling mistakes) in this lab, kindly send me an e-mail. It is not seen as nitpicky, but appreciated! (Or rather, future generations of students will appreciate it!)
  • Fun fact: The famous computer scientist Donald Knuth would pay folks one $2.56 for errors in his published works. [source]
  • Unfortunately, there is no monetary reward in this course :)