Week6 [02/11] - [04/11]

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
This commit is contained in:
IDunnoDev
2021-12-11 14:15:02 +00:00
committed by iDunnoDev
parent 3b374c1e17
commit 19639d70d1
19 changed files with 493 additions and 72 deletions

17
Model.h
View File

@ -1,7 +1,7 @@
#pragma once
#include "Polygon3D.h"
#include "Vertex.h"
#include "Matrix.h"
#include <vector>
using namespace std;
@ -15,15 +15,30 @@ public:
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;
};