[vtkusers] How to export a 3D scene in X3Db format in Java ?
Sebastien Jourdain
jourdain at artenum.com
Wed May 14 03:22:26 EDT 2008
Hello everyone,
I'm currently trying to export my 3D scene in an X3Db (binary) file
format.
I managed to make it work with the X3D format but not the X3Db one.
The printed error is right below :
[java] Cannot find required Class: x3dConverterClass
[java] Invalid memory access of location 00000000 eip=0045bb09
[java] Java Result: 138
My source code :
public static void main(String[] args) {
String fileToLoad = args[0];
String fileToWrite = args[1];
String fastinfosetFilePath = args[2];
// init
vtkPanel panel = new vtkPanel();
vtkActor actor = new vtkActor();
vtkDataSetMapper mapper = new vtkDataSetMapper();
vtkDataSetReader reader = new vtkDataSetReader();
vtkX3DExporter exporter = new vtkX3DExporter();
// Static method setting ?
vtkX3DExporterJavaHelper helper = new vtkX3DExporterJavaHelper();
helper.SetFastInfosetJarLocation(fastinfosetFilePath);
// set pipeline
reader.SetFileName(fileToLoad);
mapper.SetInput(reader.GetOutput());
actor.SetMapper(mapper);
panel.GetRenderer().AddActor(actor);
// Exporter configuration
exporter.SetRenderWindow(panel.GetRenderWindow());
exporter.SetBinary(1);
exporter.SetFileName(fileToWrite);
exporter.Update();
exporter.Write();
}
Thanks in advanced for your help,
Seb
More information about the vtkusers
mailing list