本文整理汇总了C#中Texture.SetName方法的典型用法代码示例。如果您正苦于以下问题:C# Texture.SetName方法的具体用法?C# Texture.SetName怎么用?C# Texture.SetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Texture
的用法示例。
在下文中一共展示了Texture.SetName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: rectangleRToolStripMenuItem_Click
private void rectangleRToolStripMenuItem_Click(object sender, EventArgs e)
{
TopoShape rect = GlobalInstance.BrepTools.MakeRectangle(100, 50, 10, Coordinate3.UNIT_XYZ);
rect = GlobalInstance.BrepTools.MakeFace(rect);
SceneNode node = renderView.ShowGeometry(rect, ++shapeId);
Texture texture = new Texture();
texture.SetName("mytexture");
texture.SetFilePath(new AnyCAD.Platform.Path("f:\\dimian.png"));
FaceStyle style = new FaceStyle();
style.SetTexture(0, texture);
style.SetColor(255, 255, 255);
node.SetFaceStyle(style);
TopoShape line = GlobalInstance.BrepTools.MakeLine(Vector3.ZERO, new Vector3(0, 0, 100));
TopoShape face = GlobalInstance.BrepTools.Extrude(line, 100, Vector3.UNIT_X);
renderView.ShowGeometry(face, ++shapeId);
}
示例2: coneToolStripMenuItem_Click
private void coneToolStripMenuItem_Click(object sender, EventArgs e)
{
TopoShape cylinder = GlobalInstance.BrepTools.MakeCone(new Vector3(100, 0, 0), new Vector3(0, 0, 1), 20, 100, 40, 315);
SceneNode node = renderView.ShowGeometry(cylinder, ++shapeId);
for (int i = 1; i < 10; ++i)
{
Matrix4 trf = GlobalInstance.MatrixBuilder.MakeTranslate(i * 100, 0, 0);
SceneNode aNode = renderView.ShowGeometry(cylinder, ++shapeId);
aNode.SetTransform(trf);
}
Texture texture = new Texture();
texture.SetName("mytexture");
texture.SetFilePath(new AnyCAD.Platform.Path("#Terrain\\BeachStones.jpg"));
FaceStyle style = new FaceStyle();
style.SetTexture(0, texture);
node.SetFaceStyle(style);
}
示例3: sphereToolStripMenuItem_Click
private void sphereToolStripMenuItem_Click(object sender, EventArgs e)
{
TopoShape sphere = GlobalInstance.BrepTools.MakeSphere(new Vector3(0, 0, 40), 40);
SceneNode node = renderView.ShowGeometry(sphere, ++shapeId);
Texture texture = new Texture();
texture.SetName("mytexture3");
texture.SetFilePath(new AnyCAD.Platform.Path("#test\\land_ocean_ice_2048.jpg"));
FaceStyle style = new FaceStyle();
style.SetTexture(0, texture);
node.SetFaceStyle(style);
}
示例4: cylinderToolStripMenuItem_Click
private void cylinderToolStripMenuItem_Click(object sender, EventArgs e)
{
TopoShape cylinder = GlobalInstance.BrepTools.MakeCylinder(new Vector3(180, 0, 0), new Vector3(0, 0, 1), 20, 100, 360);
Matrix4 mat= GlobalInstance.MatrixBuilder.MakeRotation(90, Vector3.UNIT_X);
cylinder = GlobalInstance.BrepTools.Transform(cylinder, mat);
SceneNode sceneNode = renderView.ShowGeometry(cylinder, ++shapeId);
FaceStyle style = new FaceStyle();
Texture texture = new Texture();
texture.SetName("mytexture2");
texture.SetFilePath(new AnyCAD.Platform.Path("#test\\houzi.jpg"));
style.SetTexture(0, texture);
sceneNode.SetFaceStyle(style);
sceneNode.SetPickable(false);
}