
Added Lighting Changes for Vertex Normal Calculation Added Method to Get a Polygons Vertices as a Vector array Added Methods to Add the Color to a Polygon and Vertex Object Added Normalization to the Polygon normal vector Added Vector Normal Calculation to the Model Class Added Light Calculation method to the Rasterizer Class Added Flag to Rasterizer to stop processing when the screen is minimised Added Flat and Gouraud Drawing Methods to the Resterizer Added Standard and INT triangle drawing Methods Added Function to mimic sgn function from Java Added Length to Vector3D class Added / operator to Vector3D class Added Get(x,y,z,w)Int methods to Vertex class Changed Color Variables on the Vertex/Polygon classes to use r, g and b values rather than COLORREF Changed Camera translation functions to use normal Translation Functions Cleaned up Code Removed Unused code from the Camera Class
42 lines
993 B
C++
42 lines
993 B
C++
#pragma once
|
|
#include "Vector3D.h"
|
|
#include "Vertex.h"
|
|
#include "SharedTools.h"
|
|
#include "Model.h"
|
|
#include "Polygon3D.h"
|
|
#include "windows.h"
|
|
|
|
class Light
|
|
{
|
|
public:
|
|
Light();
|
|
Light(int red, int green, int blue);
|
|
Light(const Light& other);
|
|
|
|
~Light();
|
|
|
|
void SetLightIntensity(int red, int green, int blue);
|
|
void SetLightIntensity(ColRef color, int value);
|
|
void SetRedLightIntensity(int value);
|
|
void SetGreenLightIntensity(int value);
|
|
void SetBlueLightIntensity(int value);
|
|
|
|
int GetLightIntensity(ColRef color) const;
|
|
int GetRedLightIntensity() const;
|
|
int GetGreenLightIntensity() const;
|
|
int GetBlueLightIntensity() const;
|
|
|
|
virtual COLORREF CalculateLight(const Model& currentModel, const Polygon3D& currentPolygon, COLORREF colorIn) = 0;
|
|
virtual COLORREF CalculateLight(const Model& currentModel, const Vertex& currentVertex, COLORREF colorIn) = 0;
|
|
|
|
Light& operator= (const Light& rhs);
|
|
|
|
protected:
|
|
int _liRed;
|
|
int _liGreen;
|
|
int _liBlue;
|
|
|
|
void Copy(const Light& other);
|
|
};
|
|
|