Пример #1
0
    void Generate()
    {
        if (SphereSource == null)
        {
            SphereSource = Kitware.VTK.vtkSphereSource.New();
        }
        if (vtkToUnity == null)
        {
            vtkToUnity = new VtkToUnity(SphereSource.GetOutputPort(), "VTK Run In Editor");
            vtkToUnity.ColorBy(Color.green);
        }
        SphereSource.SetPhiResolution(resolution);
        SphereSource.SetThetaResolution(resolution);
        SphereSource.SetRadius(1);
        SphereSource.Update();

        vtkToUnity.Update();
    }
Пример #2
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            resolution++;
        }
        if (Input.GetKeyDown(KeyCode.DownArrow) && resolution > 3)
        {
            resolution--;
        }

        if (resolution != oldResolution)
        {
            SphereSource.SetPhiResolution(resolution);
            SphereSource.SetThetaResolution(resolution);
            vtkToUnity.Update();
            oldResolution = resolution;
        }
    }