#1
|
|||
|
|||
<node3d>.save() position and rotation
I'm currently trying to apply some transformations (scale, position, rotation) to a model and save it to an .ive file using <node3d>.save(). However, all of these transformations are lost when I open the file.
I played around with the different modes for setting a position, e.g. setPosition(0,0,10,mode=viz.REL_LOCAL), but it does not seem to have any effect. Is there any way to save the model with these transformations applied? Thank you very much for your help in advance. |
#2
|
|||
|
|||
The <node3D>.save command will save a node to either the .ive or .osg format. Transformations made to the node will not be saved.
You'll need to apply the transformation in some modeling software and then export a new version of the model. |
#3
|
|||
|
|||
If you parent the model to a group node, then saving the group will preserve the transformation of the model. Example:
Code:
import viz viz.go() root = viz.addGroup() model = viz.add('dojo.osgb',parent=root) model.setEuler(180,0,0) root.save('dojo_rotated.osgb') |
#4
|
|||
|
|||
Thanks a lot, this seems to work, at least with some models. For some reason, it does not work with all - I'll have to investigate a bit. Maybe it is a format-specific glitch. Here is an example:
Code:
import viz viz.go() root = viz.addGroup() model = viz.add('dojo.osgb',parent=root) model2 = viz.add('table.wrl',parent=root) model2.setPosition(2,2,2) model.setEuler(99,0,0) model.setPosition(1,1,1) root.save('dojoandtable.ive') root.remove() viz.add("dojoandtable.ive") |
#5
|
|||
|
|||
Sorry, I forgot to mention that this will only work with the newer osgb format.
|
#6
|
|||
|
|||
Oh, thanks, that clears things up. However, once I have all my models saved as osgb, I cannot open them with any program. Even osgconv fails to convert these models to any other file (including the differnet osg file formats). Do you know of any software product that can successfully open osgb files generated by Vizard except for Vizard?
|
#7
|
|||
|
|||
Unfortunately you won't be able to load the models within an external program. Vizard uses its own osg::Transform derived class for transforming models, so this class can only be serialized within Vizard.
|
#8
|
|||
|
|||
Thanks for your help. Does WorldViz have any plans to make a working export/save function a feature of future versions of Vizard?
|
Tags |
position, rotation, save, scale, transformation |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
limiting object rotation | Philippe | Vizard | 5 | 10-07-2010 05:31 PM |
Semi-circle array containing target and distractor objects | ptjt255 | Vizard | 3 | 08-04-2009 04:09 AM |
Lightwave objects rotation problem | hosier | Vizard | 6 | 02-13-2009 01:04 PM |
Can you link the position of a tracker to the orientation of an object? | michaelrepucci | Vizard | 1 | 09-19-2008 11:23 AM |
getting absolute rotation | tavaksai | Vizard | 1 | 08-03-2004 02:40 PM |