[vtkusers] About the Render( ) function in Java
Jeff Lee
jeff at cdnorthamerica.com
Wed Feb 20 07:46:46 EST 2002
Hi,
I have included a sample which shows one way to do this. It requires
vtk4.x. HTH,
Jeff
poyo wrote:
> 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 embedded and charset-unspecified text was scrubbed...
Name: TestMain.java
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020220/b468dc19/attachment.asc>
More information about the vtkusers
mailing list