#include <Rasterizer3D.h>
A Rasterizer3D object rasterizes three-dimensional objects.
◆ Rasterizer3D()
Rasterizer3D::Rasterizer3D |
( |
FrameBuffer * |
fb | ) |
|
|
explicit |
Explicit Value Constructor.
- Parameters
-
fb | The FrameBuffer containing the pixels |
◆ ~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
-
◆ 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 |
◆ 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) |
◆ 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).
The documentation for this class was generated from the following files: