![]() | Object3DPrimitiveManagerAddPrimitiveMesh Method |
Namespace: VIZCore3DX.NET.Manager
public Node AddPrimitiveMesh( Node node, string nodeName, bool IsCreateAssembly, List<ColorMeshVertex> colorMeshVertexs, List<ushort> indices, Vector3D move )
// VIZCore3DX.NET Control private VIZCore3DX.NET.VIZCore3DXControl vizcore3dx; private void Example() { List<string> strings = new List<string>(); strings.Add("PIPE"); List<Data.Node> nodes = vizcore3dx.Object3D.Find.QuickSearch(strings, false, true, true, false, false); if (nodes.Count <= 0) return; var vertices = new List<Data.ColorMeshVertex> // 메시 정점 정보 { new ColorMeshVertex(new Data.Vector3D(0, 0, 0), Data.Axis.Z, Color.Red), new ColorMeshVertex(new Data.Vector3D(1000, 0, 0), Data.Axis.Z, Color.Green), new ColorMeshVertex(new Data.Vector3D(1000, 1000, 0), Data.Axis.Z, Color.Blue), new ColorMeshVertex(new Data.Vector3D(0, 1000, 0), Data.Axis.Z, Color.Yellow), new ColorMeshVertex(new Data.Vector3D(500, 1500, 0), Data.Axis.Z, Color.Magenta), }; var indices = new List<ushort> // 메시 인덱스 정보 (3개 단위로 삼각형을 정의) { 0, 1, 2, 0, 2, 3, 3, 2, 4, }; Data.Node node = vizcore3dx.Object3D.Primitive.AddPrimitiveMesh(nodes[0], "Primitive Mesh", true, vertices, indices, new Data.Vector3D(207699.75f, -60.75f, 6758.44)); vizcore3dx.StatusbarInfo.Text = string.Format("'{0}' 노드 생성", node.NodeName); }