
Added the Z Access to the Matrix class Added the Identity Matrix Method to the Matrix Class Added MD2Loader Class Added Model Class Added Polygon Class Added Clear Viewport Method to Rasterizer Added Z Axis to the Vertex Class Updated Transformation Matrices to pass a matrix back so that we can do the multiplication at once
39 lines
537 B
C++
39 lines
537 B
C++
#include "Model.h"
|
|
|
|
Model::Model()
|
|
{
|
|
}
|
|
|
|
Model::~Model()
|
|
{
|
|
}
|
|
|
|
const vector<Polygon3D>& Model::GetPolygons()
|
|
{
|
|
return _polygons;
|
|
}
|
|
|
|
const vector<Vertex>& Model::GetVertices()
|
|
{
|
|
return _vertices;
|
|
}
|
|
|
|
size_t Model::GetPolygonCount()
|
|
{
|
|
return _polygons.size();
|
|
}
|
|
|
|
size_t Model::GetVerticesCount()
|
|
{
|
|
return _vertices.size();
|
|
}
|
|
|
|
void Model::AddVertex(float x, float y, float z)
|
|
{
|
|
_vertices.push_back(Vertex(x, y, z));
|
|
}
|
|
|
|
void Model::AddPolygon(int index0, int index1, int index2)
|
|
{
|
|
_polygons.push_back(Polygon3D(index0, index1, index2));
|
|
} |