Inventor Coin3d --> VRML2 Export Problem

reweiss

Mitglied
Hallo,

ich habe mit Inventor (Coin3d) das Testprogramm mit dem Roboter genommen und wollte dies als VRML2 exportieren. Dazu folgender Code.

Code:
#include <Inventor/Qt/SoQt.h>
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
#include <Inventor/nodes/SoCube.h>
#include <Inventor/nodes/SoCylinder.h>
#include <Inventor/nodes/SoMaterial.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoSphere.h>
#include <Inventor/nodes/SoTransform.h>
#include <Inventor/SoDB.h>
#include <Inventor/SoInteraction.h>
#include <Inventor/SoInput.h>
#include <Inventor/SoOutput.h>
#include <Inventor/actions/SoWriteAction.h>
#include <Inventor/actions/SoToVRML2Action.h>
#include <Inventor/VRMLnodes/SoVRMLGroup.h>


main(int , char **argv)
{

   QWidget *myWindow = SoQt::init(argv[0]);
   if (myWindow == NULL) exit(1);

   SoSeparator *root = new SoSeparator;
   root->ref();
  
  // create robot - returns SoSeparator*
   root->addChild(makeRobot());
  
   if (root) {
         printf("Converting...\n");
         SoToVRML2Action tovrml2;
         tovrml2.apply(root);
         SoVRMLGroup *newroot = tovrml2.getVRML2SceneGraph();

         printf("Writing...\n");
         SoOutput out;
         out.openFile("out.wrl");
         out.setHeaderString("#VRML V2.0 utf8");
         SoWriteAction wra(&out);
         wra.apply(newroot);
         out.closeFile();
       }

   SoQtExaminerViewer *myViewer = 
            new SoQtExaminerViewer(myWindow);
   myViewer->setSceneGraph(root);
   myViewer->setTitle("Robot");
   myViewer->show();
   myViewer->viewAll();

   SoQt::show(myWindow);
   SoQt::mainLoop();
}

Der Roboter wird richtig aufgebaut und dargestellt. Wenn ich mir die VRML Datei jedoch betrachte, sieht der Roboter nicht mehr wie ein Roboter aus. Arme und Beine sind im Raum verstreut. Was heisst das die einzelnen Elemente nicht mehr an dem Platz sind wo sie eigendlich hingehören.

Hat da jemand eine Idee woran das liegen kann? Und vor allem wie man das beheben kann?

Danke schon mal
 
Zurück