[osg-users] manipulator design advice

Julia Guo mrvoltemort at gmail.com
Wed Mar 25 23:50:58 PDT 2009


I am using the osgManipulator draggers to move objects around my scene. I intend that when the R key is pressed a rotation dragger is used and when the T key is pressed a translation dragger is used. And if any other key is pressed then no draggers are used.

The manipulator example applies the draggers from the start and so doesnt face this problem.

What is a good way to arrange my scene nodes so that I can switch between drag modes? Originally I thought of using a switch node, but then only 1 transformation at a time would be applied to the model (is that right?) and I want the transformations to be maintained across modes.

I could stack the manipulators on top of each other, but then their geometry (created with setupDefaultGeometry()) would overlap. (The API doesnt support disabling a dragger.)

My current design is:
- put the model behind a transform
- when switch mode apply current dragger matrix to the transform and then remove dragger
- insert new dragger before the transform

This seems very awkward so Im hoping there is a better way!

Thank you.

Read this topic online here:

More information about the osg-users mailing list