Final Changes before submission

This commit is contained in:
IDunnoDev
2025-07-04 17:32:39 +01:00
committed by iDunnoDev
parent eeea920e45
commit ab6deb3cc2
7 changed files with 721 additions and 370 deletions

View File

@ -334,11 +334,9 @@ void Model::CalculateVertexNormals()
}
for (Vertex& currentVertex : _transformedVertices)
{
currentVertex.SetNormal(currentVertex.GetNormal() / currentVertex.GetContributeCount());
currentVertex.NormalizeNormal();
{
currentVertex.SetNormal(currentVertex.GetNormal() / currentVertex.GetContributeCount());
currentVertex.NormalizeNormal();
}
}
@ -360,4 +358,17 @@ void Model::Sort()
}
sort(_polygons.begin(), _polygons.end(), DepthCompare);
}
void Model::CalculateUVPerspective()
{
for (Polygon3D& currentPolygon : _polygons)
{
for (int cpi = 0; cpi < currentPolygon.GetPolygonVertexCount(); cpi++)
{
_transformedVertices[currentPolygon.GetIndex(cpi)].UVCorrect(_uvCoords[currentPolygon.GetUVIndex(cpi)].GetU(), _uvCoords[currentPolygon.GetUVIndex(cpi)].GetV());
}
}
}