[osg-users] Adding Constraints to Draggers

Max Power daniel.lehmann85 at hotmail.com
Thu Oct 25 05:56:42 PDT 2018


I'm quite new to OpenSceneGraph. I actually just finished to read the book "OpenSceneGraph 3.0 Beginner's Guide" and now I want to go a bit further.

Currently, I try to move objects via the mouse. I already saw, that I can use the class osgManipulator::Dragger for this. Here I wrote my own CompositeDragger, which is basically a combination of a RotateCylinderDragger and a Translate1DDrager. This means I can move the object forwards and backwards and I can rotate it via mouse. I already got this working.

However, I don't want to translate the object infinitely forwards or backwards. I just want to translate it e.g. 10 units back or 5 units forward at max. Or I want to translate it only within a certain area of the world coordinate system.

How could I do this? I assume the osgManipulator::Contraint is helpful here. However, I haven't found any examples and I don't know how to apply it.

I hope this wasn't asked before. At least I couldn't find anything similar. Are there any examples somewhere online, which you can recommend to look at?

Thank you!


Read this topic online here:

More information about the osg-users mailing list