View Single Post
Old 05-28-2009, 07:06 AM
Joran Joran is offline
Join Date: Jun 2006
Posts: 38
Send a message via Yahoo to Joran
Loading OSG models and orientation


I have a question about orientation and loading OpenSceneGraph models.

It seems that the OSGExp that can be downloaded from the worldviz site exports the model rotated and calls the root of the scene __VIZARD_NODE__. When loading the model, it will show correctly in vizard, but as soon as you rename this Root node, it will load the model rotated.

I think this mechanism is used by Vizard to detect how the model is rotated. If it does not contain the __VIZARD_NODE__ root, it will applies a modifier so it is orientated correctly for use in Vizard.

I already have a lot of models exported with another exporter. When you just load up the model it works fine, but when you change the parent of child objects, the orientation goes wrong. Here is some example code:

scene = viz.add('data/testscene.ive')
target = scene.getChild('Test1')
This piece of code rotates the Test1 child of testscene.ive. What I do is to attach the object back to the parent it already belonged to. This should not change anything in the orientation.

It this behavior a bug? Is there a workaround (without exporting all the models again)?

Greetings, Joran.
Reply With Quote