Listing 1: Drawing a sphere
#include "vtk.hh" main () { vtkRenderMaster rm; vtkRenderWindow *renWin=rm.MakeRenderWindow(); vtkRenderer *aren=renWin->MakeRenderer(); vtkRenderWindowInteractor *iren=renWin->MakeRenderWindowInteractor(); // create visualization network vtkSphereSource sphere; sphere.SetRadius(0.75); vtkPolyMapper mapper; mapper.SetInput(sphere.GetOutput()); vtkActor actor; actor.SetMapper(mapper); actor.GetProperty()->SetColor(1,0.39,0.28); // render sphere aren->AddActors(&actor); aren->SetBackground(.1,.2,.4); renWin->Render(); iren->Start(); }