本文整理汇总了C++中MeshData::SetNormalArray方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshData::SetNormalArray方法的具体用法?C++ MeshData::SetNormalArray怎么用?C++ MeshData::SetNormalArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshData
的用法示例。
在下文中一共展示了MeshData::SetNormalArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void CreatePatch(
MeshData& Mesh)
{
Mesh.SetName("Patch");
AttribData<vec3> aVertex;// = MeshArray.SetVertexArray();
aVertex.Resize(4);
aVertex.Set(0, vec3(-10.0f, 0.0f,-10.0f));
aVertex.Set(1, vec3(-10.0f, 0.0f, 10.0f));
aVertex.Set(2, vec3( 10.0f, 0.0f,-10.0f));
aVertex.Set(3, vec3( 10.0f, 0.0f, 10.0f));
Mesh.SetVertexArray(aVertex);
AttribData<vec2> aTexCoords;// = MeshArray.SetUVArray();
aTexCoords.Resize(4);
aTexCoords.Set(0, glm::vec2( 0.0f, 0.0f));
aTexCoords.Set(1, glm::vec2( 0.0f, 1.0f));
aTexCoords.Set(2, glm::vec2( 1.0f, 0.0f));
aTexCoords.Set(3, glm::vec2( 1.0f, 1.0f));
Mesh.SetUVArray(aTexCoords);
AttribData<vec3> aNormal;// = MeshArray.SetNormalArray();
aNormal.Resize(4);
aNormal.Set(0, vec3(0.0f, 1.0f, 0.0f));
aNormal.Set(1, vec3(0.0f, 1.0f, 0.0f));
aNormal.Set(2, vec3(0.0f, 1.0f, 0.0f));
aNormal.Set(3, vec3(0.0f, 1.0f, 0.0f));
Mesh.SetNormalArray(aNormal);
AttribData<vec3> aTangent;// = MeshArray.SetTangentArray();
aTangent.Resize(4);
aTangent.Set(0, vec3(1.0f, 0.0f, 0.0f));
aTangent.Set(1, vec3(1.0f, 0.0f, 0.0f));
aTangent.Set(2, vec3(1.0f, 0.0f, 0.0f));
aTangent.Set(3, vec3(1.0f, 0.0f, 0.0f));
Mesh.SetTangentArray(aTangent.GetBufferPointer(), aTangent.Size());
AttribData<vec3> aBitangent;// = MeshArray.SetBitangentArray();
aBitangent.Resize(4);
aBitangent.Set(0, vec3(0.0f, 0.0f, 1.0f));
aBitangent.Set(1, vec3(0.0f, 0.0f, 1.0f));
aBitangent.Set(2, vec3(0.0f, 0.0f, 1.0f));
aBitangent.Set(3, vec3(0.0f, 0.0f, 1.0f));
Mesh.SetBitangentArray(aBitangent);
AttribData<Polygons> aFaces;// = MeshArray.SetPolygonArray();
Polygons polys;
polys.SetMaterial(0);
polys.SetFaces().Resize(2);
polys.SetFaces().Set(0, GLFace16(0, 1, 2));
polys.SetFaces().Set(1, GLFace16(0, 2, 3));
aFaces.Resize(1);
aFaces.Set(0, polys);
Mesh.SetPolygonList(aFaces);
}