Click or drag to resize

MeshEditManagerChangeBodyMesh Method (ListInt32, ListVertex3D, ListVector3D, ListSingle, ListInt32)

Body 노드 리스트의 Mesh 를 교체

Namespace:  VIZCore3D.NET.Manager
Assembly:  VIZCore3D.NET (in VIZCore3D.NET.dll) Version: 2.8.24.1104 (2.8.24.1104)
Syntax
C#
public void ChangeBodyMesh(
	List<int> bodyIndex,
	List<Vertex3D> coords,
	List<Vector3D> normals,
	List<float> color,
	List<int> coordListNum
)

Parameters

bodyIndex
Type: System.Collections.GenericListInt32
바디 노드 인덱스 리스트
coords
Type: System.Collections.GenericListVertex3D
Coords
normals
Type: System.Collections.GenericListVector3D
Normals
color
Type: System.Collections.GenericListSingle
Color
coordListNum
Type: System.Collections.GenericListInt32
Coord. Count List
Examples
C#
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;

private void Example()
{
    List<int> bodies = new List<int>();
    List<int> coordListNum = new List<int>();
    List<VIZCore3D.NET.Data.Vertex3D> v = new List<VIZCore3D.NET.Data.Vertex3D>();
    List<VIZCore3D.NET.Data.Vector3D> n = new List<VIZCore3D.NET.Data.Vector3D>();
    List<float> color = new List<float>();

    // 면 #1
    bodies.Add(2296);     // Body Index
    coordListNum.Add(18); // Vertex Float 총 개수

    // Vertex 좌표 => Triangle Mesh 를 기반
    v.Add(new VIZCore3D.NET.Data.Vertex3D(80180.00, 10600.00, 35572.12));
    v.Add(new VIZCore3D.NET.Data.Vertex3D(71890.00, 10600.00, 35572.12));
    v.Add(new VIZCore3D.NET.Data.Vertex3D(72324.89, 7170.00, 35645.86));
    v.Add(new VIZCore3D.NET.Data.Vertex3D(72324.89, 7170.00, 35645.86));
    v.Add(new VIZCore3D.NET.Data.Vertex3D(80180.00, 7170.00, 35645.86));
    v.Add(new VIZCore3D.NET.Data.Vertex3D(80180.00, 10600.00, 35572.12));

    // Normal 좌표
    n.Add(new VIZCore3D.NET.Data.Vector3D(0.00, 0.00, -1.00));
    n.Add(new VIZCore3D.NET.Data.Vector3D(0.00, 0.00, -1.00));
    n.Add(new VIZCore3D.NET.Data.Vector3D(0.00, 0.00, -1.00));
    n.Add(new VIZCore3D.NET.Data.Vector3D(0.00, 0.00, -1.00));
    n.Add(new VIZCore3D.NET.Data.Vector3D(0.00, 0.00, -1.00));
    n.Add(new VIZCore3D.NET.Data.Vector3D(0.00, 0.00, -1.00));

    // 면의 색상 설정
    color.Add(1.000f); // R
    color.Add(1.000f); // G
    color.Add(0.000f); // B
    color.Add(1);      // A 

    // 면 #2
    bodies.Add(2293);     // Body Index
    coordListNum.Add(18); // Vertex Float 총 개수

    v.Add(new VIZCore3D.NET.Data.Vertex3D(80180.00, 7170.00, 35645.86));
    v.Add(new VIZCore3D.NET.Data.Vertex3D(72324.89, 7170.00, 35645.86));
    v.Add(new VIZCore3D.NET.Data.Vertex3D(71890.00, 3740.00, 35719.60));
    v.Add(new VIZCore3D.NET.Data.Vertex3D(71890.00, 3740.00, 35719.60));
    v.Add(new VIZCore3D.NET.Data.Vertex3D(80180.00, 3740.00, 35719.60));
    v.Add(new VIZCore3D.NET.Data.Vertex3D(80180.00, 7170.00, 35645.86));

    n.Add(new VIZCore3D.NET.Data.Vector3D(0.00, 0.00, -1.00));
    n.Add(new VIZCore3D.NET.Data.Vector3D(0.00, 0.00, -1.00));
    n.Add(new VIZCore3D.NET.Data.Vector3D(0.00, 0.00, -1.00));
    n.Add(new VIZCore3D.NET.Data.Vector3D(0.00, 0.00, -1.00));
    n.Add(new VIZCore3D.NET.Data.Vector3D(0.00, 0.00, -1.00));
    n.Add(new VIZCore3D.NET.Data.Vector3D(0.00, 0.00, -1.00));

    color.Add(0.043f); // R
    color.Add(0.043f); // G
    color.Add(0.043f); // B
    color.Add(1);      // A

    vizcore3d.MeshEdit.ChangeBodyMesh(
        bodies          /* BODY INDEX LIST */
        , v             /* VERTEX LIST */
        , n             /* NORMAL LIST */
        , color         /* COLOR */
        , coordListNum  /* VERTEX COUNT LIST */
        );
}
See Also