09-14-2020, 09:54 PM
As janovrom has explained, the order of rotations matters (expect if you rotate around the same axis then you can add or substitute the angles). Also the order of transformation matters: if you first do translation and then rotation, you will get different results as if you first rotate and then do a translation.
Usually you first scale, then rotate and finally translate.
But you can also simplify transformation with using StandardTransformaton3D. Note that because it is not possible to derive from Transform3D, you cannot simply assign StandardTransformaton3D to Transform property - instead you first create StandardTransformaton3D object and then assign its Transform property to Model3D.Transform or Visual3D.Transform - for example:
With StandardTransformaton3D you can use TranslateX, TranslateY, TranslateY; ScaleX, ScaleY, ScaleZ; RotateX, RotateY, RotateZ properties.
Usually you first scale, then rotate and finally translate.
But you can also simplify transformation with using StandardTransformaton3D. Note that because it is not possible to derive from Transform3D, you cannot simply assign StandardTransformaton3D to Transform property - instead you first create StandardTransformaton3D object and then assign its Transform property to Model3D.Transform or Visual3D.Transform - for example:
Code:
var sphereVisual3D = new SphereVisual3D();
var standardTransform3D = new StandardTransform3D()
{
RotateX = 30,
RotateY = 10,
TranslateX = 100
};
sphereVisual3D.Transform = standardTransform3D.Transform;With StandardTransformaton3D you can use TranslateX, TranslateY, TranslateY; ScaleX, ScaleY, ScaleZ; RotateX, RotateY, RotateZ properties.
Andrej Benedik

