Hi Paul,
I ran into this dillemna recently while working on an app and then
again while working on the code for
FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS.  My solution
was the same as Robert's:  place your graph under a temporary Group
node, then flatten it, then retrieve the child of the Group node
whatever it may be.

Just setting the root Transform node to identity didn't appeal to me.
The point of the optimization in all cases I have seen is to remove
transforms from the modelview stack since they can cause a big
performance hit in sufficient numbers.  Even if the matrix is identity
you would still have the performance hit unless OSG is smart enough to
treat such a Transform like a Group.

I hope this is useful, but it sounds like your situation might be more
complicated than mine.
- Terry
>
> Message: 14
> Date: Fri, 24 Oct 2008 15:53:47 -0600
> From: "Paul Martz" <[EMAIL PROTECTED]>
> Subject: Re: [osg-users] Problems flattening static transforms
> To: "'OpenSceneGraph Users'" <osg-users@lists.openscenegraph.org>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain;       charset="US-ASCII"
>
> Thanks, I see the light now.
>
> I wrote my own FlattenStaticTransforms NodeVisitor to just fold the
> transform into the geometry and set the transformation to identity; It works
> great as long as all Transforms are MatrixTransforms.
>
> (It'd be nice if there were a virtual osg::Transform::setIdentity() method
> to easily allow code to set any Transform Node to the identity. For example,
> see Optimizer.cpp starting at line 1080. It makes sense for PATs and
> DOFTransforms, but maybe not for Camera...)
>   -Paul
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to