Week9 [23/11] - [29/11]

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
This commit is contained in:
IDunnoDev
2021-12-11 19:26:56 +00:00
committed by iDunnoDev
parent f5fd5b6756
commit df3c9fac81
23 changed files with 956 additions and 188 deletions

View File

@ -16,7 +16,7 @@ public:
~Model();
vector<Polygon3D>& GetPolygons(void);
const vector<Vertex>& GetVertices(void);
vector<Vertex>& GetVertices(void);
const vector<Matrix>& GetPendingTransforms(void);
size_t GetPolygonCount(void);
@ -32,6 +32,10 @@ public:
const Vertex& GetVertex(int polygonIndex, int vertexPolygonIndex) const;
const Vertex& GetVertex(int index) const;
vector<Vertex> GetPolygonVertexArray(int index) const;
void SetPolygonColor(int index, COLORREF color);
void SetVertexColor(int polyIndex, int vertIndex, COLORREF color);
void SetReflectionCoefficient(float red, float green, float blue);
void SetReflectionCoefficient(ColRef color, float value);
void SetRedReflectionCoefficient(float value);
@ -48,6 +52,7 @@ public:
void DehomogenizeAllVertices(void);
void CalculateBackfaces(Camera& currentCamera);
void CalculateVertexNormals();
void Sort(void);
private: