[vtkusers] VTK42, Matlab (R13), Java

Philippe Pouletaut philippe.pouletaut at utc.fr
Wed Oct 29 04:23:34 EST 2003


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20031029/9b9fc8b4/attachment.htm>


More information about the vtkusers mailing list