Pivot Point for RotationManipulator

Jan 14, 2012 at 6:12 AM


I just needed the RotatonManipulator and figured out that there is no property to provide a pivot (= center of the rotation). It might appear as it is not necessary, but the current manipulator only rotates an object around its center if the geometry is centered around the origin. If the objects geometry is shifted (i.e. the actual vertex positions are such that the object does not center around the origin) than the object does not rotate around its center, but around its actual local origin. This point can now be set with the Pivot property. Note in most cases the geometry is centered properly such that it can be left at (0,0,0). A good test case is a box with its min corner at (0,0,0) and max at (1,1,1).

I added the prop to the abstract Manipulator class and changed the rotation call (OnMouseMove in the RotationManipulator class). I also provided these props to the CombinedManipulater class. Further I added a Bind and UnBind method for easy in-code-binding, since someone was asking how does it work:

    /// <summary>
    /// Binds this manipulator to a given Visual3D.
    /// </summary>
    /// <param name="source">Source Visual3D which receives the manipulator transforms.</param>
    public virtual void Bind(ModelVisual3D source)
        BindingOperations.SetBinding(this, CombinedManipulator.TargetTransformProperty, new Binding("Transform") { Source = source });
        BindingOperations.SetBinding(this, CombinedManipulator.TransformProperty, new Binding("Transform") { Source = source });

    /// <summary>
    /// Releases the binding of this manipulator.
    /// </summary>
    public virtual void UnBind()
        BindingOperations.ClearBinding(this, CombinedManipulator.TargetTransformProperty);
        BindingOperations.ClearBinding(this, CombinedManipulator.TransformProperty);


I will sent you the patch, maybe you want to integrate it. Cheers. P.

Jan 16, 2012 at 6:16 AM

Great! I submitted these changes. Should also add an example in the ManipulatorDemo...