本文整理汇总了C#中Surface.AddTriangle方法的典型用法代码示例。如果您正苦于以下问题:C# Surface.AddTriangle方法的具体用法?C# Surface.AddTriangle怎么用?C# Surface.AddTriangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Surface
的用法示例。
在下文中一共展示了Surface.AddTriangle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createCube
//.........这里部分代码省略.........
surf.VertexNormal(5,0.0f,0.0f,1.0f);
surf.VertexNormal(6,0.0f,0.0f,1.0f);
surf.VertexNormal(7,0.0f,0.0f,1.0f);
surf.VertexNormal(8,0.0f,-1.0f,0.0f);
surf.VertexNormal(9,0.0f,1.0f,0.0f);
surf.VertexNormal(10,0.0f,1.0f,0.0f);
surf.VertexNormal(11,0.0f,-1.0f,0.0f);
surf.VertexNormal(12,0.0f,-1.0f,0.0f);
surf.VertexNormal(13,0.0f,1.0f,0.0f);
surf.VertexNormal(14,0.0f,1.0f,0.0f);
surf.VertexNormal(15,0.0f,-1.0f,0.0f);
surf.VertexNormal(16,-1.0f,0.0f,0.0f);
surf.VertexNormal(17,-1.0f,0.0f,0.0f);
surf.VertexNormal(18,1.0f,0.0f,0.0f);
surf.VertexNormal(19,1.0f,0.0f,0.0f);
surf.VertexNormal(20,-1.0f,0.0f,0.0f);
surf.VertexNormal(21,-1.0f,0.0f,0.0f);
surf.VertexNormal(22,1.0f,0.0f,0.0f);
surf.VertexNormal(23,1.0f,0.0f,0.0f);
surf.VertexTexCoords(0,0.0f,1.0f,0.0f,0);
surf.VertexTexCoords(1,0.0f,0.0f,0.0f,0);
surf.VertexTexCoords(2,1.0f,0.0f,0.0f,0);
surf.VertexTexCoords(3,1.0f,1.0f,0.0f,0);
surf.VertexTexCoords(4,1.0f,1.0f,0.0f,0);
surf.VertexTexCoords(5,1.0f,0.0f,0.0f,0);
surf.VertexTexCoords(6,0.0f,0.0f,0.0f,0);
surf.VertexTexCoords(7,0.0f,1.0f,0.0f,0);
surf.VertexTexCoords(8,0.0f,1.0f,0.0f,0);
surf.VertexTexCoords(9,0.0f,0.0f,0.0f,0);
surf.VertexTexCoords(10,1.0f,0.0f,0.0f,0);
surf.VertexTexCoords(11,1.0f,1.0f,0.0f,0);
surf.VertexTexCoords(12,0.0f,0.0f,0.0f,0);
surf.VertexTexCoords(13,0.0f,1.0f,0.0f,0);
surf.VertexTexCoords(14,1.0f,1.0f,0.0f,0);
surf.VertexTexCoords(15,1.0f,0.0f,0.0f,0);
surf.VertexTexCoords(16,0.0f,1.0f,0.0f,0);
surf.VertexTexCoords(17,0.0f,0.0f,0.0f,0);
surf.VertexTexCoords(18,1.0f,0.0f,0.0f,0);
surf.VertexTexCoords(19,1.0f,1.0f,0.0f,0);
surf.VertexTexCoords(20,1.0f,1.0f,0.0f,0);
surf.VertexTexCoords(21,1.0f,0.0f,0.0f,0);
surf.VertexTexCoords(22,0.0f,0.0f,0.0f,0);
surf.VertexTexCoords(23,0.0f,1.0f,0.0f,0);
surf.VertexTexCoords(0,0.0f,1.0f,0.0f,1);
surf.VertexTexCoords(1,0.0f,0.0f,0.0f,1);
surf.VertexTexCoords(2,1.0f,0.0f,0.0f,1);
surf.VertexTexCoords(3,1.0f,1.0f,0.0f,1);
surf.VertexTexCoords(4,1.0f,1.0f,0.0f,1);
surf.VertexTexCoords(5,1.0f,0.0f,0.0f,1);
surf.VertexTexCoords(6,0.0f,0.0f,0.0f,1);
surf.VertexTexCoords(7,0.0f,1.0f,0.0f,1);
surf.VertexTexCoords(8,0.0f,1.0f,0.0f,1);
surf.VertexTexCoords(9,0.0f,0.0f,0.0f,1);
surf.VertexTexCoords(10,1.0f,0.0f,0.0f,1);
surf.VertexTexCoords(11,1.0f,1.0f,0.0f,1);
surf.VertexTexCoords(12,0.0f,0.0f,0.0f,1);
surf.VertexTexCoords(13,0.0f,1.0f,0.0f,1);
surf.VertexTexCoords(14,1.0f,1.0f,0.0f,1);
surf.VertexTexCoords(15,1.0f,0.0f,0.0f,1);
surf.VertexTexCoords(16,0.0f,1.0f,0.0f,1);
surf.VertexTexCoords(17,0.0f,0.0f,0.0f,1);
surf.VertexTexCoords(18,1.0f,0.0f,0.0f,1);
surf.VertexTexCoords(19,1.0f,1.0f,0.0f,1);
surf.VertexTexCoords(20,1.0f,1.0f,0.0f,1);
surf.VertexTexCoords(21,1.0f,0.0f,0.0f,1);
surf.VertexTexCoords(22,0.0f,0.0f,0.0f,1);
surf.VertexTexCoords(23,0.0f,1.0f,0.0f,1);
surf.AddTriangle(0,1,2); // front
surf.AddTriangle(0,2,3);
surf.AddTriangle(6,5,4); // back
surf.AddTriangle(7,6,4);
surf.AddTriangle(6+8,5+8,1+8); // top
surf.AddTriangle(2+8,6+8,1+8);
surf.AddTriangle(0+8,4+8,7+8); // bottom
surf.AddTriangle(0+8,7+8,3+8);
surf.AddTriangle(6+16,2+16,3+16); // right
surf.AddTriangle(7+16,6+16,3+16);
surf.AddTriangle(0+16,1+16,5+16); // left
surf.AddTriangle(0 + 16, 5 + 16, 4 + 16);
surf.build ();
return surf.getMesh ();
}