@@ -0,0 +1,2764 @@
+import vtk.vtkRenderWindow;%0Aimport vtk.vtkActor;%0Aimport vtk.vtkPoints;%0Aimport vtk.vtkNativeLibrary;%0Aimport vtk.vtkPolyDataMapper;%0Aimport vtk.vtkRenderer;%0Aimport vtk.vtkRenderWindowInteractor;%0Aimport vtk.vtkPolyData;%0Aimport vtk.vtkTriangle;%0Aimport vtk.vtkUnsignedCharArray;%0Aimport vtk.vtkCellArray;%0Aimport vtk.vtkNamedColors;%0A%0Apublic class TriangleColoredPoints %0A%7B%0A  //-----------------------------------------------------------------%0A  // Load VTK library and print which library was not properly loaded%0A  static%0A  %7B%0A    if (!vtkNativeLibrary.LoadAllNativeLibraries()) %0A    %7B%0A      for (vtkNativeLibrary lib : vtkNativeLibrary.values()) %0A      %7B%0A        if (!lib.IsLoaded()) %0A        %7B%0A          System.out.println(lib.GetLibraryName() + %22 not loaded%22);%0A        %7D%0A      %7D%0A    %7D%0A    vtkNativeLibrary.DisableOutputWindow(null);%0A  %7D%0A  // -----------------------------------------------------------------%0A%09%0A  public static void main(String args%5B%5D) %0A  %7B%0A%0A    vtkNamedColors colors = new vtkNamedColors();%0A%0A    //Renderer Background Color%0A    double Bgcolor%5B%5D = new double%5B4%5D;%0A%0A    colors.GetColor(%22Black%22, Bgcolor);%0A%0A    // Setup points%0A    vtkPoints Points = new vtkPoints();%0A    Points.InsertNextPoint(0.0, 0.0, 0.0);%0A    Points.InsertNextPoint(1.0, 0.0, 0.0);%0A    Points.InsertNextPoint(0.0, 1.0, 0.0);%0A%0A    //Setup the colors array%0A    vtkUnsignedCharArray Colors = new vtkUnsignedCharArray();%0A    Colors.SetNumberOfComponents(3);%0A    Colors.SetName(%22Colors%22);%0A   %0A   //Add the three colors we have created to the array%0A    Colors.InsertNextTuple3(255,0, 0);%0A    Colors.InsertNextTuple3(0, 255, 0);%0A    Colors.InsertNextTuple3(0, 0, 255);%0A%0A    //Create a triangle%0A    vtkCellArray Triangles = new vtkCellArray();%0A    vtkTriangle Triangle = new vtkTriangle();%0A    Triangle.GetPointIds().SetId(0, 0);%0A    Triangle.GetPointIds().SetId(1, 1);%0A    Triangle.GetPointIds().SetId(2, 2);%0A    Triangles.InsertNextCell(Triangle);%0A%0A    //Create a polydata object and add everything to it%0A    vtkPolyData PolyData = new vtkPolyData();%0A    PolyData.SetPoints(Points);%0A    PolyData.SetPolys(Triangles);%0A    PolyData.GetPointData().SetScalars(Colors);%0A%0A    vtkPolyDataMapper Mapper = new vtkPolyDataMapper();%0A    Mapper.SetInputData(PolyData);%0A%0A    vtkActor Actor = new vtkActor();%0A    Actor.SetMapper(Mapper);%0A%0A    //Create the renderer, render window and interactor.%0A    vtkRenderer ren = new vtkRenderer();%0A    vtkRenderWindow renWin = new vtkRenderWindow();%0A    renWin.AddRenderer(ren);%0A    vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();%0A    iren.SetRenderWindow(renWin);%0A%0A    // Visualize the actor%0A    ren.AddActor(Actor);%0A    ren.SetBackground(Bgcolor);%0A%0A    renWin.SetSize(300, 300);%0A    renWin.Render();%0A%0A    iren.Initialize();%0A    iren.Start();%0A%0A  %7D%0A%7D%0A

Create TriangleColoredPoints.java