I'd like to report a bug with this method:
public static Transform3D GetVisual3DTotalTransform(Visual3D rootVisual3D, Visual3D finalVisual3D, bool addFinalVisualTransformation, out bool isVisual3DConnected)
Specifically this line: transformGroup.Children.Insert(0, oneTransform);
The bug: The method returns the wrong order in the matrix multiplication. It returns T_Parent, T_Child instead of T_Child, T_Parent. I provide sample unit test in text file attachment where the first assert passes (group vs SRT) and the second assert fails (group from the method vs SRT).
Expected behavior: Given this hierarchy of objects
Visual3D - name: "Translation"
Visual3D - name: "Rotation"
Visual3D - name: "Scale"
I expect to get transformation matrix that works like this: T * R * S * point.
Usage:
var mR = new ContentVisual3D();
var mS = new ContentVisual3D();
var mT = new ContentVisual3D();
mR.SetName("Rotation");
mS.SetName("Scale");
mT.SetName("Translation");
mS.Transform = S;
mR.Transform = R;
mT.Transform = T;
mR.Children.Add(mS);
mT.Children.Add(mR);
TransformationsHelper.GetVisual3DTotalTransform(mT, mS, true, out Transform3D visualSRT);
What I get:
Given this insertion into the transformation group transformGroup.Children.Insert(0, oneTransform) the transformation I get is S * R * T * point, which is not correct order of transformations. It could be worked around, but when the hieararchy is not simply these basic transformations it is not possible to change the order (especially since it is bound to the rendering).
If not feature: Simply replacing Insert with Add should solve this.
Best regards,
Janovský Roman
public static Transform3D GetVisual3DTotalTransform(Visual3D rootVisual3D, Visual3D finalVisual3D, bool addFinalVisualTransformation, out bool isVisual3DConnected)
Specifically this line: transformGroup.Children.Insert(0, oneTransform);
The bug: The method returns the wrong order in the matrix multiplication. It returns T_Parent, T_Child instead of T_Child, T_Parent. I provide sample unit test in text file attachment where the first assert passes (group vs SRT) and the second assert fails (group from the method vs SRT).
Expected behavior: Given this hierarchy of objects
Visual3D - name: "Translation"
Visual3D - name: "Rotation"
Visual3D - name: "Scale"
I expect to get transformation matrix that works like this: T * R * S * point.
Usage:
var mR = new ContentVisual3D();
var mS = new ContentVisual3D();
var mT = new ContentVisual3D();
mR.SetName("Rotation");
mS.SetName("Scale");
mT.SetName("Translation");
mS.Transform = S;
mR.Transform = R;
mT.Transform = T;
mR.Children.Add(mS);
mT.Children.Add(mR);
TransformationsHelper.GetVisual3DTotalTransform(mT, mS, true, out Transform3D visualSRT);
What I get:
Given this insertion into the transformation group transformGroup.Children.Insert(0, oneTransform) the transformation I get is S * R * T * point, which is not correct order of transformations. It could be worked around, but when the hieararchy is not simply these basic transformations it is not possible to change the order (especially since it is bound to the rendering).
If not feature: Simply replacing Insert with Add should solve this.
Best regards,
Janovský Roman

