[vtkusers] exporting scene to vrml format

Philippe PhD. David pdavid at scconsultants.com
Thu Feb 16 08:31:15 EST 2017


hello,

I am currently trying to export a scene using vtkVRMLExporter() from my 
vtk application.
My scene is built from a set of geometries  which are then moved/rotated 
internally to my application (with user input) using 
vtkAssembly::SetPosition(...) and vtkAssembly::SetOrientation(...)

Unfortunately, the exported scene reports only the initial 
position/orientation of my differents objects. Any suggestions on how to 
take into accounts those move/orientation in the exported scene ? Also 
the view type (surface, wireframe, mesh, opacity) is not correctly 
exported.

thanks in advance for help
Philippe



// my function to export the scene
bool VisualisationVtk::Visualisation::SaveVRML(String^ Filename)
{
     vtkVRMLExporter *Exporter;

     Exporter= vtkVRMLExporter::New();
     Exporter->SetRenderWindow(Window);

     pin_ptr<const wchar_t> wch = PtrToStringChars(Filename);
     char file[256];
     size_t convertedChars = 0;
     size_t  sizeInBytes = ((Filename->Length + 1) * 2);
     wcstombs_s (&convertedChars,file, sizeInBytes,wch, sizeInBytes);
     Exporter->SetFileName(file);

     draw();  // loops on all objects and hide/view update surface/mesh 
view move/rotate upon users requests

  Exporter->Write();
     Exporter->Delete();

     return true;
}


-- 





---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170216/80c7f551/attachment.html>


More information about the vtkusers mailing list