Пример #1
0
    public VtkToUnity(Kitware.VTK.vtkAlgorithmOutput outputPort, string name)
    {
        this.name      = name;
        triangleFilter = Kitware.VTK.vtkTriangleFilter.New();
        triangleFilter.SetInputConnection(outputPort);
        go = new GameObject(name);

        MeshFilter meshFilter = go.AddComponent <MeshFilter>();

        meshFilter.sharedMesh = mesh;
        go.AddComponent <MeshRenderer>();
    }
Пример #2
0
    public VtkToUnity(Kitware.VTK.vtkAlgorithmOutput outputPort, GameObject newGo)
    {
        name           = newGo.name;
        triangleFilter = Kitware.VTK.vtkTriangleFilter.New();
        triangleFilter.SetInputConnection(outputPort);

        GameObject.DestroyImmediate(newGo.GetComponent <MeshFilter>());
        GameObject.DestroyImmediate(newGo.GetComponent <MeshRenderer>());

        go = newGo;

        MeshFilter meshFilter = go.AddComponent <MeshFilter> ();

        meshFilter.sharedMesh = mesh;
        go.AddComponent <MeshRenderer> ();
    }