Julien-Charles Levesque wrote:
Hi,
I'm currently working with PositionAttitudeTransform controlled objects in my
environment. Some objects are clearly too big, some too small. So I set their
scale using the setScale function. Problem is that this scale is transmitted
automatically to children of the Transforms, and I do not want that. Sure I
could apply the inverse of the scale factor to each children, but that doesn't
seem like a clean solution to me.
I want my children to receive the position and orientation modifications, alas
not the scale modifications. There must be a simple way to do this, right ?
What you're seeing is part of the nature of a scene graph. Each child
inherits the coordinate system of its parent.
A simple solution is to create a MatrixTransform node, set a scale on it
(use Matrix::makeScale), and attach the object model to that
transform. Then, you can attach the MatrixTransform to the
PositionAttitudeTransform.
A possible shortcut for this could also be to use the "scale"
pseudoloader. For example, if you are currently loading a model called
"model.obj", you can instead load "model.obj.(3.0).scale", and it will
automatically insert a scale transform above the loaded object.
--"J"
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org