[vtkusers] About the Render( ) function in Java

poyo scj90 at dvis.cs.ccu.edu.tw
Wed Feb 20 03:02:33 EST 2002


Dear VTKers;

In C++, some loops that do a azimuth of the cameras per iteration like below

for(i=0; i <360; i+=9) {
    ren->GetActiveCamera()->Azimuth(9);
    renWindow->Render
}

And I have using VTKPanel instead of vtkRenderWindow, I try to write the code like this

public static void main(String[] args) {
  JFrame frame;
  frame = new JFrame("sample");
  vtkPanel renwin = new vtkPanel();
  vtkConeSource cone = new vtkConeSource();
  frame.getContentPane().add("Center",renwin);
  cone.SetResolution(16);
  vtkPolyDataMapper coneMapper = new vtkPolyDataMapper();
  coneMapper.SetInput(cone.GetOutput());
  vtkActor coneActor = new vtkActor();
  coneActor.SetMapper(coneMapper);
  renwin.GetRenderer().AddActor(coneActor);
  renwin.GetRenderer().SetBackground(0.2,0.5,0.3);
  ren.GetActiveCamra().Azimuth(90);
  frame.pack();
  frame.setVisible(true);
  for(int i=0; i<360; i+=9) {
   renwin.GetRenderer().GetActiveCamera().Azimuth(9);
   renwin.GetRenderWindow().Render();
  }
}
but it doesn't work...:~~
How to use it in Java?
or there'll another way to do so??

Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020220/de3938be/attachment.htm>


More information about the vtkusers mailing list