Click or drag to resize

Object3DPrimitiveManagerAddPrimitiveMesh Method

Primitive Mesh 생성 위치와, 법선 방향이 동일한 정점은 공유해서 사용 삼각형의 인덱스는 3의 배수로 구성되어야 하며, 각 3개는 하나의 삼각형을 나타냄 삼각형의 인덱스 순서는 외부에서 면을 바라볼 때 반시계 방향으로 설정되어야 함

Namespace:  VIZCore3DX.NET.Manager
Assembly:  VIZCore3DX.NET (in VIZCore3DX.NET.dll) Version: 1.1.25.827 (1.1.25.827)
Syntax
C#
public Node AddPrimitiveMesh(
	Node node,
	string nodeName,
	bool IsCreateAssembly,
	List<ColorMeshVertex> colorMeshVertexs,
	List<ushort> indices,
	Vector3D move
)

Parameters

node
Type: VIZCore3DX.NET.DataNode
Primitive 부모 노드
nodeName
Type: SystemString
노드 이름
IsCreateAssembly
Type: SystemBoolean
Assembly 노드 생성 여부(선택된 노드가 Assembly 일 경우 생성 또는 미생성, Part 인 경우에는 Assembly 생성 안됨)
colorMeshVertexs
Type: System.Collections.GenericListColorMeshVertex
색상 메시 정점 목록 (count >= 3)
indices
Type: System.Collections.GenericListUInt16
인덱스 목록
move
Type: VIZCore3DX.NET.DataVector3D
이동값

Return Value

Type: Node
생성된 Node 정보
Examples
C#
// 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);
}
See Also