![]() |
CS488 PA7
|
#include "../pa6/Color.h"#include "../pa6/Geometry.hpp"#include <list>#include "../pa5/Matrix.hpp"#include <stdio.h>#include "Triangle.h"Go to the source code of this file.
Functions | |
| Matrix< 4, 2 > | findBounds (list< Triangle *> triangles) |
| void | read (const char *fileName, list< Triangle *> *triangles) |
| void | scaleAndTranslate (list< Triangle *> triangles, double width, double height, double depth) |
Functions for working with triangular meshes.
A triangular mesh is stored as a list<Triangle*> (i.e., a list of pointers to Triangle objects).
Notes:
| Matrix<4, 2> findBounds | ( | list< Triangle *> | triangles | ) |
Find the bounds of a triangular mesh.
The bounds are returned as a Matrix of 2 points in 4-D. One point contains the minimum value for all dimensions and the other contains the maximum value for all dimensions.
| triangles | The "triangular mesh" (i.e., the list of Triangle*) |
| void read | ( | const char * | fileName, |
| list< Triangle *> * | triangles | ||
| ) |
Read a triangular mesh.
| fileName | The name of the file to read from |
| triangles | The "triangular mesh" to populat |
| void scaleAndTranslate | ( | list< Triangle *> | triangles, |
| double | width, | ||
| double | height, | ||
| double | depth | ||
| ) |
Scales and translates the given Triangle objects so that they fit within a rectangular solid and are centered at 0,0. The aspect ratio of the Triangle objects will remain unchanged.
| triangles | The Triangle objects to scale and translate |
| width | The width of the rectangle |
| height | The height of the rectangle |
| depth | The depth of the rectangle |
1.8.13