
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
34 lines
954 B
C++
34 lines
954 B
C++
#pragma once
|
|
#include "Framework.h"
|
|
#include "Vertex.h"
|
|
#include "Matrix.h"
|
|
#include <vector>
|
|
|
|
enum class Axis { X, Y, Z };
|
|
|
|
class Rasteriser : public Framework
|
|
{
|
|
public:
|
|
bool Initialise();
|
|
void Update(const Bitmap& bitmap);
|
|
void Render(const Bitmap& bitmap);
|
|
void ClearViewport(const Bitmap& bitmap);
|
|
|
|
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);
|
|
|
|
private:
|
|
vector<Vertex> _initialVertexArray;
|
|
vector<Vertex> _currentVertexArray;
|
|
const float _PI = (float) acos(-1);
|
|
int _rotation;
|
|
};
|
|
|