Lab 10
Topic: OpenGL
Getting started:
- point browser to https://skatgame.net/mburo/courses/350
- click on B10 in the schedule
- use id/pw listed on eclass to get access if asked
- this should bring up this page
Part 1 (14:00)
- Assignment 3 solution
- Lab exercise 9 solution
Part 2 (14:25)
- Prep problems (see below)
Part 3 (15:20)
Part 4 (15:30)
Prep Problem
-
Visit prep/ and download make, squares, and squares.cpp
-
Complete squares.cpp such that it generates an animation resembling the one
created by ./squares
Steps:
- Draw the same model three times at different locations by calling
function draw_shape after setting up the correct geometric transformation for
the individual shapes
- Hook up keys u,d,l,r to change drawing angles
- Enable the OpenGL depth test to render the squares correctly in 3d
- Colour the background yellow
Use ./make to compile your code
Hints:
- To save the modelview matrix before applying any transformation use
glPushMatrix(). To restore it before drawing the next shape use
glPopMatrix()
- DON'T FORGET glutSwapBuffers(). If you do, your computer will freeze (see below)!
-
In case your workstation freezes, use
ctrl-alt-f1
to get a terminal in which you can kill your process, and
ctrl-alt-f7
to get back.
Alternatively, you can use alt-sysreq-k
to log out
Reference material:
sample code
OpenGL
glut
Prep Solutions
Lab Exercise
Secrets