Asg 2: Rotating, Translating, Texture-mapped Quad
Objectives
Implement a program to render a 2D texture-mapped quad that
rotates in place and translates.
Assignment
- Make sure the quad rotates in place, i.e., rotates about its center.
This means you will need to compute the object's centroid
or average of all of its vertices.
- Additionally, implement object translation such that the quad translates
in any pattern you like around the screen (could be circular, could be
bouncing off the window borders, could be moving with the mouse
cursor, etc.). You will need to make sure that the order of
tranformations is how they were presented, reading them from
right-to-left.
Suggestions
- You could store the object's object center point in a
vec3 oc
variable.
Input
- It would be nice if you could store the quad object vertices
(and texture coordinates) in a file.
- You will need to read in both vertex and fragment shaders from files,
e.g.,
passthru.vert
and passthru.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.
Output
- The quad should be texture-mapped with correct rotations and tranlsations.
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