Week8 [16/11] - [19/11]
Added Light Base Class Added AmbientLight, DirectionalLight and PointLight Classes Added Constructor to the Camera Class Added Light CoEff's to the Model Class Added Color Variables to Polygon3D Class Added Light Vector to hold the lights in the Rasteriser Added Camera Vector to hold multiple Cameras and Methods to set which is the current Added Lighting to the Rasterizer Added DrawSolidFlat method to the Rastorizer Added Bounds Check to the SharedTools for Int and Float values Added Color Enum Class Added Normalize Method to the Vector3D Class Renamed the TransformTools to SharedTools since adding more non transform methods to it
This commit is contained in:
20
Rasteriser.h
20
Rasteriser.h
@ -1,15 +1,20 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include "Framework.h"
|
||||
#include "Vector3D.h"
|
||||
#include "Vertex.h"
|
||||
#include "Matrix.h"
|
||||
#include "TransformTools.h"
|
||||
#include "SharedTools.h"
|
||||
#include "Camera.h"
|
||||
#include "Model.h"
|
||||
#include "MD2Loader.h"
|
||||
#include <vector>
|
||||
#include "Light.h"
|
||||
#include "AmbientLight.h"
|
||||
#include "DirectionalLight.h"
|
||||
#include "PointLight.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace TransformTools;
|
||||
using namespace SharedTools;
|
||||
|
||||
class Rasteriser : public Framework
|
||||
{
|
||||
@ -19,13 +24,22 @@ public:
|
||||
void Render(const Bitmap& bitmap);
|
||||
void ClearViewport(const Bitmap& bitmap);
|
||||
|
||||
void SetCurrentCamera(int index);
|
||||
Camera& GetCamera(int index);
|
||||
Camera& GetCurrentCamera();
|
||||
|
||||
void DrawSquare(HDC hDc, const vector<Vertex> verticies);
|
||||
void DrawShape(HDC hDc, const vector<Vertex> verticies);
|
||||
|
||||
void DrawWireFrame(HDC hDc, Model& model);
|
||||
void DrawSolidFlat(HDC hDc, Model& model);
|
||||
|
||||
private:
|
||||
vector<Model> _sceneModels;
|
||||
vector<Light*> _lights;
|
||||
vector<Camera> _cameras;
|
||||
|
||||
int _currentCamera = 0;
|
||||
|
||||
Matrix _currentPerspectiveMatrix;
|
||||
Matrix _currentViewMatrix;
|
||||
|
Reference in New Issue
Block a user