本文整理汇总了C++中Model3D::GetNormalMapOn方法的典型用法代码示例。如果您正苦于以下问题:C++ Model3D::GetNormalMapOn方法的具体用法?C++ Model3D::GetNormalMapOn怎么用?C++ Model3D::GetNormalMapOn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model3D
的用法示例。
在下文中一共展示了Model3D::GetNormalMapOn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawSolidTexturedNormalMapped
// Draws the given model with texturing, shading and a normal map.
void Rasterizer::DrawSolidTexturedNormalMapped(Model3D& model, std::vector<DirectionalLight*> directionalLights, std::vector<AmbientLight*> ambientLights, std::vector<PointLight*> pointLights)
{
std::vector<Polygon3D> _polygonList = model.GetPolygonList();
std::vector<Vertex> _vertexList = model.GetTransformedVertexList();
std::vector<UVCoordinate> _uvCoordList = model.GetUVCoordinateList();
for (unsigned int i = 0; i < _polygonList.size(); i++)
{
Polygon3D poly = _polygonList[i];
if (poly.GetBackfacing() == true)
continue;
Vertex v1 = _vertexList[poly.GetVertexIndex(0)];
Vertex v2 = _vertexList[poly.GetVertexIndex(1)];
Vertex v3 = _vertexList[poly.GetVertexIndex(2)];
// Set the uv coordinates of each vertex temporarily to the coordinates in the
// uv coordinate list.
v1.SetUVCoordinate(_uvCoordList[poly.GetUVIndex(0)]);
v2.SetUVCoordinate(_uvCoordList[poly.GetUVIndex(1)]);
v3.SetUVCoordinate(_uvCoordList[poly.GetUVIndex(2)]);
// Fill the polygon using the models texture.
if (model.GetNormalMapOn() == true)
FillPolygonTexturedNormalMapped(v1, v2, v3, v1.GetColor(), model, directionalLights, ambientLights, pointLights);
else
FillPolygonTextured(v1, v2, v3, v1.GetColor(), model);
}
}