@@ -0,0 +1,2104 @@
+import vtk.vtkActor;%0Aimport vtk.vtkSphereSource;%0Aimport vtk.vtkNativeLibrary;%0Aimport vtk.vtkPolyDataMapper;%0A%0Aimport vtk.vtkRenderWindow;%0Aimport vtk.vtkNamedColors;%0Aimport vtk.vtkRenderer;%0Aimport vtk.vtkRenderWindowInteractor;%0A%0Apublic class BackgroundGradient%0A%7B%0A%09// -----------------------------------------------------------------%0A%09// Load VTK library and print which library was not properly loaded%0A%09static %0A%09%7B%0A%09%09if (!vtkNativeLibrary.LoadAllNativeLibraries()) %0A%09%09%7B%0A%09%09%09for (vtkNativeLibrary lib : vtkNativeLibrary.values()) %0A%09%09%09%7B%0A%09%09%09%09if (!lib.IsLoaded()) %0A%09%09%09%09%7B%0A%09%09%09%09%09System.out.println(lib.GetLibraryName() + %22 not loaded%22);%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09vtkNativeLibrary.DisableOutputWindow(null);%0A%09%7D%0A%09// -----------------------------------------------------------------%09%0A%09%0A%09public static void main(String args%5B%5D) %0A%09%7B%0A%09%09vtkNamedColors colors = new vtkNamedColors();%0A%0A%09%09//For Actor Color%0A%09%09double actorColor%5B%5D = new double%5B4%5D;%0A%09%09%0A%09%09//Renderer Background Color%0A%09%09double Bgcolor%5B%5D = new double%5B4%5D;%0A%09%09%0A%09%09//Renderer Background Color%0A%09%09double Bgcolor_2%5B%5D = new double%5B4%5D;%0A        %0A%09%09colors.GetColor(%22MediumSpringGreen%22, actorColor);%0A%09%09colors.GetColor(%22Banana%22, Bgcolor);%0A%09%09colors.GetColor(%22Tomato%22, Bgcolor_2);%0A        %0A%09%09//Create a Sphere%0A%09%09vtkSphereSource Sphere = new vtkSphereSource();%0A%09%09Sphere.Update();%0A%0A%09%09//Create a Mapper and Actor%0A%09%09vtkPolyDataMapper Mapper = new vtkPolyDataMapper();%0A%09%09Mapper.SetInputConnection(Sphere.GetOutputPort());%0A%0A%09%09vtkActor Actor = new vtkActor();%0A%09%09Actor.SetMapper(Mapper);%0A%09%09Actor.GetProperty().SetColor(actorColor);%0A        %0A%09%09        %0A%09%09// Create the renderer, render window and interactor.%0A%09%09vtkRenderer ren = new vtkRenderer();%0A%09%09vtkRenderWindow renWin = new vtkRenderWindow();%0A%09%09renWin.AddRenderer(ren);%0A%09%09vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();%0A%09%09iren.SetRenderWindow(renWin);%0A%0A%09%09// Visualise the arrow%0A%09%09ren.AddActor(Actor);%0A%09%09%0A%09%09//Setting up the background gradient%0A%09%09ren.GradientBackgroundOn();%0A%09%09ren.SetBackground(Bgcolor);%0A%09%09ren.SetBackground2(Bgcolor_2);%0A%0A%09%09renWin.SetSize(300, 300);%0A%09%09renWin.Render();%0A%0A%09%09iren.Initialize();%0A%09%09iren.Start();%0A%09%7D%0A%7D%0A

Create BackgroundGradient.java