private VIZCore3DX.NET.VIZCore3DXControl vizcore3dx;
private void Example()
{
List<Data.Node> nodes = vizcore3dx.Object3D.FromFilter(Object3dFilter.SELECTED_TOP);
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>
{
0, 1, 2,
0, 2, 3,
3, 2, 4,
};
List<Data.PrimitiveMesh> Mesh = new List<Data.PrimitiveMesh>();
Mesh.Add(new Data.PrimitiveMesh(
"Part",
vertices,
indices,
new Data.Vector3D(6000.0f, 1000.0f, 1000.0f)
));
List<Data.Node> part = vizcore3dx.Object3D.Primitive.AddMultiPrimitiveMesh(nodes[0], "Part_Mesh", Mesh, false);
List<Data.PrimitiveMesh> bodyMesh = new List<Data.PrimitiveMesh>();
bodyMesh.Add(new Data.PrimitiveMesh(
"Body1",
vertices,
indices,
new Data.Vector3D(0.0f, 1000.0f, 1000.0f)
));
bodyMesh.Add(new Data.PrimitiveMesh(
"Body2",
vertices,
indices,
new Data.Vector3D(3000.0f, 1000.0f, 1000.0f)
));
bodyMesh.Add(new Data.PrimitiveMesh(
"Body3",
vertices,
indices,
new Data.Vector3D(9000.0f, 1000.0f, 1000.0f)
));
bodyMesh.Add(new Data.PrimitiveMesh(
"Body4",
vertices,
indices,
new Data.Vector3D(12000.0f, 1000.0f, 1000.0f)
));
vizcore3dx.Object3D.Primitive.AddMultiPrimitiveMesh(part[0], "Node", bodyMesh);
}