[osg-users] Resize a shape?

Ulrich Hertlein u.hertlein at sandbox.de
Wed Oct 24 17:58:37 PDT 2007


Hi Patrick,

Quoting Patrick Maier <maierp at gmx.net>:
> >> I've a cylinder, and while showing the scene, I want to change the size
> >> (height) of the cylinder.
> >> I tried it that way, but only the first call of setting the height is a
> >> success (so the height of the cylinder stays at 0.1):
>...
> Is this the normal way to do so, or is this inefficient and there is a
> better way to resize a cylinder/shape?

Another way to resize the shape is to put a Transform (osg::MatrixTransform or
osg::PositionAttitudeTransform) node above your Geode and set the scale on
that. (Maybe you already have a Transform to move the shape around?)

It probably depends on how often you want to change the shape. The recompile of
the display list certainly has some overhead but if you only infrequently you
may be OK. Using a Transform node is probably faster if you resize the shape on
every frame.

Cheers,
/ulrich



More information about the osg-users mailing list