Try the ".rot" pseudo-loader to pre-rotate a model. There is sample usage
in the code:

https://github.com/openscenegraph/osg/blob/master/src/osgPlugins/rot/ReaderWriterROT.cpp

There are also "scale" and "trans" loader for scaling and translating.


Glenn Waldron / @glennwaldron


On Thu, Oct 3, 2013 at 12:17 PM, Chris Stankevitz <[email protected]
> wrote:

> Hello,
>
> My application loads vehicles as .osg or .flt files and draws them on
> a map.  It loads the models using osgEarth::Annotation::ModelNode.  My
> code assumes the models are oriented in a particular manner (x-axis
> points out the nose, z axis points down).
>
> Unfortunately I now have a model that is not oriented properly (it's
> x-axis points out the roof).  I see three ways to deal with this:
>
> 1. When the model is loaded, ask it to silently modify itself to
> appear as if it were generated in the orientation that I prefer.  No
> other code in my application changes.
>
> 2. Modify my "dynamic placement and rotation code" to include
> if-statements to rotate differently depending on how the model was
> originally created.
>
> 3. Modify the model using some kind of model editing software (which I
> have never used)... perhaps something like Google Sketchup.
>
> My preference is to do #1 or #3.  My preference is to not do #2 since
> it doesn't encapsulate the logic and it will litter my code with if
> statements.
>
> Is it possible to do #1 with osg?
>
> Can you recommend an approach to deal with this problem?
>
> Thank you,
>
> Chris
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to