[vtkusers] VTK42, Matlab (R13), Java

Philipp.Batchelor philipp.batchelor at kcl.ac.uk
Wed Oct 29 06:00:09 EST 2003


I did the same, (uner linux), and encountered similar problems. I think, 
if I remember correctly, that you have to copy the vtkPanel.class to 
c:/Program Files/Vtk42/java and jar it into c:/Program 
Files/Vtk42/java/vtk.jar. Good news is I did manage to get it to work in 
the end.

Ph


Philippe Pouletaut wrote:
> Hello,
>  
>   I wanted to put VTK working within Matlab (R13) by importing Java 
> classes but I didn't succeed.
> I have done the following :
> 1.  Installation of VTK42 (precompiled) for Windows including vtk.jar
> 2.  Installation of j2sdk1.4.2_02 (http://java.sun.com/products/jdk/1.1/)
> 3.  Run Matlab R13. 
> 4.  Include in the file 'classpath.txt' the directory of java classes.
>     c:/Program Files/Vtk42/java/vtk.jar
>     c:/Program Files/Vtk42/java
> 5.  Restart Matlab.  Use the following sample code to verify everthing 
> is working:
> %cone.m
> import vtk.*
> panel=vtkPanel;  % essential first step for all VTK java
> ren1=vtkRenderer;
> renWin=vtkRenderWindow;
> renWin.AddRenderer(ren1);
> iren=vtkRenderWindowInteractor;
> iren.SetRenderWindow(renWin);
> cam1=ren1.GetActiveCamera;
> cam1.SetEyeAngle(5)
>  
> cone=vtkConeSource;
> cone.SetResolution(8)
> coneMapper=vtkPolyDataMapper;
> coneMapper.SetInput(cone.GetOutput);
> coneActor=vtkActor;
> coneActor.SetMapper(coneMapper);
> ren1.AddActor(coneActor);
> iren.Initialize;
>  
> % end of file
>  
> 6. Launching the program cone, it stops at the second line
> because Matlab doesn't know vtkPanel classe.
>  
> Can anyone help me ?
>  
> Thank you for your attention.
>  
> Philippe





More information about the vtkusers mailing list