Hi Paul,
I've got the same thing working with OSG with the osgmanipulators
however these manipulators (seem to?) rely on setupDefaultGeometry()
to create handles. I would rather have the original subtle approach,
where the object itself acts as the "handle" and the scene is not
cluttered with other objects.
Is there an easy way to do this or will I have to create my own
specialised dragger?
Check out the code for createDefaultGeometry() for your selected
dragger. You will see that it essentially creates some geometry under
the dragger (geodes as children of the dragger, which is a subclass of
MatrixTransform). Often, there is additional geometry created only to
make picking easier, but never displayed - for example:
// Create an invisible cylinder for picking the line.
{
osg::Cylinder* cylinder =
new osg::Cylinder (osg::Vec3(0.0f,0.0f,0.5f), 0.015f, 1.0f);
osg::Drawable* geometry = new osg::ShapeDrawable(cylinder);
setDrawableToAlwaysCull(*geometry);
geode->addDrawable(geometry);
}
The important part is setDrawableToAlwaysCull(), which is a protected
method of osgManipulator::Dragger. So if, for example, you want to
create a TranslatePlaneDragger which does not display its geometry, you
could just subclass TranslatePlaneDragger, and then in
createDefaultGeometry() you would only create an invisible quad which
would align with the plane you want to translate along, using is
setDrawableToAlwaysCull(). That way, intersections would be found on
that plane and the dragger would behave as you want, but it would not
display any geometry for the dragger itself.
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay [EMAIL PROTECTED]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org