GouraudShader
class.
This assignment is about 3-D computer graphics. You will not use any new aspects of C++.
double
array named intensities
contains the intensity of the light at each of the three vertexes
in the Triangle
. They are denoted \(I_a\),
\(I_b\), and \(I_c\) in the lecture notes. The
elements of the intensities
array should be
initialized in the setTriangle()
method of
the GouraudShader
using the lightng model
from the lecture notes.
calculateColor()
method in a Colorizer
is passed several parameters. The first three relate to the first vertex
of the "from" side of the Triangle
, and the next three
relate to the "to" side of the Triangle
.
Recall that a Triangle
contains three vertexes.
The fromSideFirstIndex
is the first vertex of
the "from" side and the fromSideSecondIndex
is
the second vertex of the "from" side. The same idea is used for
the "to" side.
phi
contains the interpolation weight for
the "from" side (which is denoted by \(\phi\) in
the lecture notes on shading). Similarly, tau
contains the interpolation weight for the "to" side (which
is denoted by \(\tau\) in the lecture notes).
pi
contains the interpolation weight for each
pixel on the scan line (which is denoted
by \(\pi\) in the lecture notes).
calulcateColor()
method in the
GouraudShader
should use
the intensities
array and the red, green, and
blue components of the (front) Color
attribute of the
vertexes of the Triangle
.
Obviously, you should feel free to ask any other questions you may have.
teapot.txt
and fighter.txt
data files
from programming assignment 7. The resulting
images should look something like the following:
.pdf
files containing the images generated
by your implementation using Canvas.
Copyright 2020