Asg 5: Go normal
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.
Assignment
- Use the
normals.[vert|geom|frag]
shader object
to render normals:
- vertex normals must be computed as average of all face
normals incident on any given vertex (you cannot
use an object loading library for this)
- face normals may be computed in the normals shader
Suggestions
- Your
aw_t
C++ class must compute face and vertex
normals after the object has been read in (an object loading
library cannot be used in this assignment)
- How to start?
- start by rendering your textured object in 3D, i.e.,
set up the perspective and view matrices and
test this first
- you will need to read in both passthru and normals
shader to render both the object (pass 1) and its
normals (pass 2)
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.,
passthru.vert
and passthru.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.
Output
- The object should rotate and translate correctly.
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