Final Changes before submission
This commit is contained in:
21
Model.cpp
21
Model.cpp
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user