09-08-2022, 01:22 PM
First, sorry for the late answer. There were some problems with forum emails and therefore your post were missed.
I have updated the ViewCubeCameraController by adding a new IsHeadingRotationInvertedWhenUpsideDown property - when true (by default) then the heading direction is inverted when the ViewCube is shown upside down (y pointing down). This way the rotation of the ViewCube follows the mouse direction.
If you want I can send you a pre-release version with this feature. Just send my a private message and tell me if you need a trial or a commercial version.
If you were using the ModelRotatorVisual3D with the source code that came with Ab3d.PowerToys.samples, then you may use the following updated code for the AddTransform method:
I have updated the ViewCubeCameraController by adding a new IsHeadingRotationInvertedWhenUpsideDown property - when true (by default) then the heading direction is inverted when the ViewCube is shown upside down (y pointing down). This way the rotation of the ViewCube follows the mouse direction.
If you want I can send you a pre-release version with this feature. Just send my a private message and tell me if you need a trial or a commercial version.
If you were using the ModelRotatorVisual3D with the source code that came with Ab3d.PowerToys.samples, then you may use the following updated code for the AddTransform method:
Code:
// Insert Transform3D before any TranslateTransform3D
// Order of transformation is important: scale, rotate, translate !!!
private void AddTransform(Visual3D visual3D, Transform3D transform3D)
{
if (visual3D.Transform == null)
{
visual3D.Transform = transform3D;
return;
}
var transform3DGroup = visual3D.Transform as Transform3DGroup;
if (transform3DGroup == null)
{
// If there is already some other transformation, then create a new Transform3DGroup
// and add existing transformation as its first child.
transform3DGroup = new Transform3DGroup();
transform3DGroup.Children.Add(visual3D.Transform);
visual3D.Transform = transform3DGroup;
}
if (transform3DGroup.Children.Count > 0)
{
int insertIndex = 0;
for (int i = 0; i < transform3DGroup.Children.Count; i++)
{
if (transform3DGroup.Children[i] is TranslateTransform3D)
break;
insertIndex++;
}
transform3DGroup.Children.Insert(insertIndex, transform3D);
}
else
{
transform3DGroup.Children.Add(transform3D);
}
}
Andrej Benedik

