[vtkusers] 3 questions about VTK + Java.

Jeff Lee jeff at cdnorthamerica.com
Wed Nov 27 07:02:38 EST 2002


tony Lincoln wrote:

>Dear all, 
>
>I am a beginner of VTK. Here 3 questions about VTK +
>Java:
>
>1. How to get more VTK example codes for java from
>Internet? What I have is only cone.java, and it seems
>not enough.
>  
>
the cvs version of vtk has a few examples in Wrapping/Java/. There is an 
internal frames demo, an example of how to attach a 
vtkGenericRenderWindowInteractor (vtkCanvas) and a java listener version 
(vtkPanel). There is also a port of the ImagePlaneWidget for an example 
of how to use 3d widgets in java.

>2. How to combine String and VTK together. The book
>"VTK user guide" told me there is a vtkPanel class in
>vtk.jar, which can combine these 2 together. I can not
>find it in vtk.jar, but find it in vkt40Src directory.
>With it I tried to run simpleVTK.java, but the error
>information is:
>Can not locate the beginning point of your program 
>_DSGetDrawingSurface at 8 on the awt.dll.
>That seems that Swing and VTK are still not combined
>together.
>
What platform? What version of java? What version of vtk? Yes, vtkPanel 
is not in vtk.jar, but that is not a requirement for it to run.

>
>3. How to produce Mouse Event on the 3D object in VTK
>viewer window? 
>For example, Using mouse to rotate the 3D object
>around its center?
>
See the examples above. There are many ways to accomplish this. The 
preferred way is to use vtkRenderWindowInteractor and 
vtkInteractorStyle. This allows the use of 3d widgets and all other 
interactor styles available through vtk (see vtkCanvas.java). The 
alternative is to use java mouse listeners and manipulate the 
camera/actor manually (this is what vtkPanel.java does). Good luck,
-Jeff

>
>many thanks.
>tony
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
>http://mailplus.yahoo.com
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers
>
>
>  
>






More information about the vtkusers mailing list