
Added Camera Class Added *= operator to the matrix class Added Transformation Queue vector to the Model Class Added Get Vertex, Polygon and Polygon Vertex methods to the Model Class Added DehomogenizeAllVerticies method to the Model Class Added GetPolygonVertexCount method to Polygon Class Added Ability to have multiple models in a "scene" in the Rasterizer Added DrawWireFrame method to the Rasterizer Class Added Aspect Ratio and View Matrix to the Rasterizer Class Added TransformTools namespace to hold shared transformation functions Added Dehomogenize method to the Vector Class Moved Transformation methods to a new shared name space
45 lines
991 B
C++
45 lines
991 B
C++
#pragma once
|
|
#include "Polygon3D.h"
|
|
#include "Vertex.h"
|
|
#include "Matrix.h"
|
|
#include <vector>
|
|
|
|
using namespace std;
|
|
|
|
class Model
|
|
{
|
|
public:
|
|
Model();
|
|
|
|
~Model();
|
|
|
|
const vector<Polygon3D>& GetPolygons();
|
|
const vector<Vertex>& GetVertices();
|
|
const vector<Matrix>& GetPendingTransforms();
|
|
|
|
size_t GetPolygonCount();
|
|
size_t GetVerticesCount();
|
|
size_t GetPendingTransformCount();
|
|
|
|
void AddVertex(float x, float y, float z);
|
|
void AddPolygon(int index0, int index1, int index2);
|
|
void EnqueueTransform(Matrix transform);
|
|
void ClearPendingTransforms();
|
|
|
|
Polygon3D GetPolygon(int index);
|
|
Vertex GetVertex(int polygonIndex, int vertexPolygonIndex);
|
|
Vertex GetVertex(int index);
|
|
|
|
void ApplyTransformToLocalVertices(const Matrix& transform);
|
|
void ApplyTransformToTransformedVertices(const Matrix& transform);
|
|
void DehomogenizeAllVertices();
|
|
|
|
private:
|
|
vector<Polygon3D> _polygons;
|
|
vector<Vertex> _vertices;
|
|
vector<Vertex> _transformedVertices;
|
|
vector<Matrix> _pendingTransforms;
|
|
|
|
};
|
|
|