#include <Rasterizer3D.h>
|
| Rasterizer3D (FrameBuffer *fb, Colorizer *colorizer) |
|
| ~Rasterizer3D () |
|
void | clear (const Color &color) |
|
void | draw (list< Triangle *> triangles) |
|
void | fill (list< Triangle *> triangles) |
|
void | useDimetricView (double phi) |
|
void | useIsometricView () |
|
void | useThreePointPerspectiveView (double d, double tx, double ty, double tz, double phi, double theta) |
|
void | useTrimetricView (double phi, double theta) |
|
void | useTwoPointPerspectiveView (double d, double ty, double tz, double theta) |
|
A Rasterizer3D object rasterizes three-dimensional objects.
◆ Rasterizer3D()
Rasterizer3D::Rasterizer3D |
( |
FrameBuffer * |
fb, |
|
|
Colorizer * |
colorizer |
|
) |
| |
Explicit Value Constructor. (New in PA8)
- Parameters
-
fb | The FrameBuffer containing the pixels |
colorizer | The Colorizer to use |
◆ ~Rasterizer3D()
Rasterizer3D::~Rasterizer3D |
( |
| ) |
|
◆ clear()
void Rasterizer3D::clear |
( |
const Color & |
color | ) |
|
Fill the entire FrameBuffer with the given color.
- Parameters
-
◆ draw()
void Rasterizer3D::draw |
( |
list< Triangle *> |
triangles | ) |
|
Draw a list of Triangle objects.
- Parameters
-
triangles | The Triangle objects |
◆ drawTriangle()
void Rasterizer3D::drawTriangle |
( |
Color |
color, |
|
|
Matrix< 4, 3 > |
triangle |
|
) |
| |
|
private |
Draw a single triangle.
- Parameters
-
color | The color to use |
triangle | The triangle to draw |
◆ fill()
void Rasterizer3D::fill |
( |
list< Triangle *> |
triangles | ) |
|
Fill a list of Triangle objects. (New in PA8)
- Parameters
-
triangles | The Traingle objects to fill. |
◆ fillTriangle()
void Rasterizer3D::fillTriangle |
( |
Triangle * |
triangle | ) |
|
|
private |
Fill a single Triangle. (New in PA8)
- Parameters
-
triangle | The Triangle to fill |
◆ updatePerspectiveMatrix()
void Rasterizer3D::updatePerspectiveMatrix |
( |
double |
d | ) |
|
|
private |
Update the perspective matrix.
- Parameters
-
◆ updateRotationXMatrix() [1/2]
void Rasterizer3D::updateRotationXMatrix |
( |
double |
sinPhi, |
|
|
double |
cosPhi |
|
) |
| |
|
private |
Update the matrix for rotating around the x-axis.
- Parameters
-
sinPhi | The sin of the rotation angle |
cosPhi | The cos of the rotation angle |
◆ updateRotationXMatrix() [2/2]
void Rasterizer3D::updateRotationXMatrix |
( |
double |
phi | ) |
|
|
private |
Update the matrix for rotating around the x-axis.
- Parameters
-
phi | The rotation angle (in radians) |
◆ updateRotationYMatrix() [1/2]
void Rasterizer3D::updateRotationYMatrix |
( |
double |
sinTheta, |
|
|
double |
cosTheta |
|
) |
| |
|
private |
Update the matrix for rotating around the y-axis.
- Parameters
-
sinTheta | The sin of the rotation angle |
cosTheta | The cos of the rotation angle |
◆ updateRotationYMatrix() [2/2]
void Rasterizer3D::updateRotationYMatrix |
( |
double |
theta | ) |
|
|
private |
Update the matrix for rotating around the y-axis.
- Parameters
-
theta | The rotation angle (in radians) |
◆ updateTranslationMatrix()
void Rasterizer3D::updateTranslationMatrix |
( |
double |
tx, |
|
|
double |
ty, |
|
|
double |
tz |
|
) |
| |
|
private |
Update the translation matrix.
- Parameters
-
tx | The size of the translation in the x-direction |
ty | The size of the translation in the y-direction |
tz | The size of the translation in the z-direction |
◆ useDimetricView()
void Rasterizer3D::useDimetricView |
( |
double |
phi | ) |
|
Instructs the rasterizer to use a dimetric view. Specifically, this method updates the two rotation matrices so that they are appropriate for a dimetric view.
- Parameters
-
phi | The rotation around the x-axis (in radians) |
◆ useIsometricView()
void Rasterizer3D::useIsometricView |
( |
| ) |
|
Instructs the rasterizer to use an isometric view. Specifically, this method updates the two rotation matrices so that they are appropriate for an isometric view.
◆ useThreePointPerspectiveView()
void Rasterizer3D::useThreePointPerspectiveView |
( |
double |
d, |
|
|
double |
tx, |
|
|
double |
ty, |
|
|
double |
tz, |
|
|
double |
phi, |
|
|
double |
theta |
|
) |
| |
Instructs the rasterizer to use a three-point perspective view. Specifically, this method updates the rotation and translation matrices so that they are appropriate for a three-point perspective view.
- Parameters
-
d | The COP |
tx | Translation along the x-axis |
ty | Translation along the y-axis |
tz | Translation along the z-axis |
phi | Rotation around the x-axis (in radians) |
theta | Rotation around the y-axis (in radians) |
◆ useTrimetricView()
void Rasterizer3D::useTrimetricView |
( |
double |
phi, |
|
|
double |
theta |
|
) |
| |
Instructs the rasterizer to use a trimetric view. Specifically, this method updates the two rotation matrices so that they are appropriate for a trimetric view.
- Parameters
-
phi | Rotation around the x-axis (in radians) |
theta | Rotation around the y-axis (in radians) |
◆ useTwoPointPerspectiveView()
void Rasterizer3D::useTwoPointPerspectiveView |
( |
double |
d, |
|
|
double |
ty, |
|
|
double |
tz, |
|
|
double |
theta |
|
) |
| |
Instructs the rasterizer to use a two-point perspective view. Specifically, this method updates the rotation and translation matrices so that they are appropriate for a two-point perspective view.
- Parameters
-
d | The COP |
ty | Translation along the y-axis |
tz | Translation along the z-axis |
theta | Rotation around the y-axis (in radians) |
◆ colorizer
The COlorizer to use. (New in PA8)
◆ downsize
Matrix<2, 4> Rasterizer3D::downsize |
|
private |
An intermediate variable used to reduce the dimensionality of a triangle.
◆ height
double Rasterizer3D::height |
|
private |
The height of the raster (in pixels).
◆ perspective
Matrix<4, 4> Rasterizer3D::perspective |
|
private |
◆ projection
Matrix<4, 4> Rasterizer3D::projection |
|
private |
◆ rasterizer2D
Rasterizer2D* Rasterizer3D::rasterizer2D |
|
private |
◆ rotationX
Matrix<4, 4> Rasterizer3D::rotationX |
|
private |
The rotation around the x-axis Matrix.
◆ rotationY
Matrix<4, 4> Rasterizer3D::rotationY |
|
private |
The rotation around the y-axis Matrix.
◆ translation
Matrix<4, 4> Rasterizer3D::translation |
|
private |
◆ width
double Rasterizer3D::width |
|
private |
The width of the raster (in pixels).
◆ zbuffer
The documentation for this class was generated from the following files: