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

View File

@ -2,9 +2,14 @@
#include "Framework.h"
#include "Vertex.h"
#include "Matrix.h"
#include "TransformTools.h"
#include "Camera.h"
#include "Model.h"
#include "MD2Loader.h"
#include <vector>
enum class Axis { X, Y, Z };
using namespace std;
using namespace TransformTools;
class Rasteriser : public Framework
{
@ -17,17 +22,16 @@ public:
void DrawSquare(HDC hDc, const vector<Vertex> verticies);
void DrawShape(HDC hDc, const vector<Vertex> verticies);
Matrix GetTranslateMatrix(const float x, const float y, const float z);
Matrix GetScaleMatrix(const float x, const float y, const float z);
Matrix GetRotationMatrix(const Axis rotAxis, const float rotDegrees);
Matrix GetRotationMatrixFromPoint(const Axis rotAxis, const float rotDegrees, const float x, const float y, const float z);
float DegreesToRadians(const float degrees);
void DrawWireFrame(HDC hDc, Model& model);
private:
vector<Vertex> _initialVertexArray;
vector<Vertex> _currentVertexArray;
const float _PI = (float) acos(-1);
vector<Model> _sceneModels;
Matrix _currentPerspectiveMatrix;
Matrix _currentViewMatrix;
float _currentAspectRatio;
int _rotation;
};