Hi,

I am trying to add a 2D box to my scene (consisting of lines 1 pixel wide) that 
a user can resize by dragging the sides or corners, or rotate by dragging a 
handle.  I'm attempting to use the osgManipulator Dragger classes for this 
purpose.  I created a subclass of CompositeDragger and added to it a 
Scale2DDragger (for the corners) and two Scale1DDraggers (for each pair of 
sides).  Basically the code is a copy of the TabPlaneDragger without the 
TranslatePlaneDragger child dragger.

I added the dragger to my scene using the osgManipulator example as a guide.  
My scene looks like this:

Group
  |                           \
MatrixTransform           CustomDragger
 |
Geode (containing box geometry)

and I call addTransformUpdating() on CustomDragger passing the MatrixTransform. 
 The box resizes correctly when I drag the handles.

A problem I am having is that the drag handles will not stay a constant size.  
If I drag the box so that one side is longer than the other, the handle boxes 
will have the same non-uniform scaling.  I am using AutoTransform and 
AntiSquish in my code exactly the way TabPlaneDragger does to prevent this from 
happening, but for some reason it doesn't work in my code (although it works in 
the osgManipulator example).

The only real difference in my code is that I set a rotation matrix in the 
CustomDragger, in order to draw the drag boxes in the XY plane (it seems to 
default to the XZ plane).  

What could be causing the drag handles to scale instead of staying a constant 
screen size?

What I ultimately want is for the entire box to be draggable.  So I want the 
handles to cover the box, and be a constant few pixels wide in screen 
coordinates regardless of the zoom level.  Then I will make the handles 
invisible so only the 1-pixel wide box is visible.  Any advice on how to do 
this?

(I am using OSG 3.0.0.)
... 

Thank you!

Cheers,
Michael

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50761#50761





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to