[vtkusers] Localization problem

Carlos Martinez cmarbur at iti.upv.es
Wed Jan 14 06:15:47 EST 2004


Hi all.

I think I have a problem about localization using VTK. I'm doing a program 
to convert an scene to VRML using vtkVRMLExporter. I use Java wrapper and 
I'm in Spain.

The problem is that, when I use the exporter, floating point numbers are 
writed using ',' instead of '.', that is expected in VRML. I have the same 
problem using vtkGL2PSExporter to export to PDF.

I don't know where is the error but when I do the program in C++ I don't 
get it. I have look at the sources and simple printf methods are used so I 
don't know where is the problem. I think it is on the wrapper. Do you know 
something about it? How could I get '.' instead of ','?

Thanks in advance.

-- 
----------------------------------------------------------------------
Carlos Martínez Burgos      |     Instituto Tecnológico de Informática
Ingeniero Informático       |      Universidad Politécnica de Valencia
Tlf: +34 963877237          |                        Camí de Vera, S/N
cmarbur at iti.upv.es          |                   46071 Valencia - Spain
www.iti.upv.es/~cmarbur     |                           www.iti.upv.es
----------------------------------------------------------------------
-------------- next part --------------
import vtk.*;

public class VRMLDemo {
    static {
        System.loadLibrary("vtkCommonJava");
        System.loadLibrary("vtkRenderingJava");
    }
    
    public final static void main(String[] args) {
        String filename = "test.wrl";
        if (args.length > 0) filename = args[0];
        
        vtkRenderer renderer = new vtkRenderer();
        vtkRenderWindow window = new vtkRenderWindow();

        window.AddRenderer(renderer);

        vtkSphereSource sphere = new vtkSphereSource();

        vtkPolyDataMapper mapper = new vtkPolyDataMapper();
        mapper.SetInput(sphere.GetOutput());

        vtkActor actor = new vtkActor();
        actor.SetMapper(mapper);
 
        renderer.AddActor(actor);
        renderer.Render();

        vtkVRMLExporter exporter = new vtkVRMLExporter();
        exporter.SetRenderWindow(window);
        exporter.SetFileName(filename);
        exporter.Write();
    }
}



More information about the vtkusers mailing list