[vtkusers] VRMLImport with Java on Linux

Thomas Krueger krueger at techinfo.rwth-aachen.de
Mon Jun 11 14:17:58 EDT 2001


Hi,
I just tried to use the following java-code for tests with the vtkVRMLImporter:

import vtk.*;
import vtk.vtkRenderer;
import java.applet.*;
import java.awt.*;

public class VRMLTest extends Applet {
  public void init () {
     vtkPanel thePanel = new vtkPanel();
     thePanel.setSize(150,150);
     vtkRenderer theRenderer;
     vtkRenderWindow theRenderWindow;
     vtkVRMLImporter theImporter = new vtkVRMLImporter();
     theImporter.SetRenderWindow(thePanel.getRenderWindow());
     theImporter.SetFileName("./test.wrl");
     theImporter.Read();
     theImporter.GetRenderer().SetBackground(0.1,0.2,0.4);
     theImporter.GetRenderWindow().SetSize(150,150);
     vtkCamera theCamera = new vtkCamera();
     theCamera.SetFocalPoint(0,0,0);
     add(thePanel);
  }
}

This works fine on WindowsNT with vtk3.2 and Java 2 1.3. The VRML-File contains
a small object (Points <= 0.9999). If I try to load the object with the same
code on Linux (VTK 3.2, Java 1.3.1), nothing is displayed. I have to enlarge the
object's dimension in the VRML-File first. The VRMLImporter seems to drop
precision for numbers less than zero. How can I solve this problem?
The 3DSImporter works fine on Linux.

Thanks,
Tom




More information about the vtkusers mailing list