Asg 7: Camera!
Objectives
Implement a program to render a 3D object (textured or not) that
rotates in place and translates, and where its face and vertex
normals are displayed, is lit using Phong lighting, and where you can
manipulate the camera in 6DOF (3 translations and 3 rotations).
Assignment
- Implement a
cam_t
C++ camera object to allow manipulation
of the camera:
- the camera object should store the
pos
,
ref
, and
vup
parameters that are used in the lookAt
function
to set up the view matrix.
- use whatever
glfw
user input you find appealing so
long as you provide the information in a README
file
Suggestions
- Your
cam_t
C++ class should include functions for:
- camera rotations (pan, tilt, roll)
- camera translations (truck, dolly, pedestal)
- camera reset to the default orientation, tied to the
R
keyboard key
- To get appreciable rotation of the referrence point, you should
place it fairly far away, e.g., at
(0,0,-1000.0)
.
Input
- Use our
pyramid.obj
file that we came up with in class
as input.
- You will need to read in both vertex and fragment shaders from files,
e.g.,
phong.vert
and phong.frag
.
- You will also need to read in all three vertex, geometry, and fragment
shaders from files, e.g.,
normals.vert
,
normals.geom
, and normals.frag
.
- Make sure to include an image file your program is to read as the
texture (you could use our
ppm_t
class for
*.ppm
images of the stb
class from
the learnopengl tutorial) if you choose to texture map your object.
- You will need to send to your Phong shader the camera position,
light position, and you will need to split up your
MVP
matrix into its constituent parts,
namely
M
, V
, and P
.
Output
- The object should rotate and translate correctly.
- The camerea should rotate and translate correctly, allowing full
360 degree rotation.
Supplemental
- Provide a
Makefile
with a README
if there
any special program running instructions.
Turn in
Turn in all of your code, in one tar.gz
archive of your asg##/ directory, including:
- A
README
file containing
- Course id--section no
- Name
- Brief solution description
(e.g., program design, description of
algorithm, etc., however appropriate).
- Lessons learned, identified interesting features of your
program
- Any special usage instructions
Makefile
- source code (
.h
headers and .cpp
source)
object code
(do a make clean
before tar
)
How to hand in
See handin
notes