04-23-2020, 11:02 AM
Do you mean SphereVisual3D.CenterPosition as the "centerposition"?
You have two options:
1) instead of applying a TranslatTransform3D on the SphereVisual3D, you can just change the value of the CenterPosition.
2) to get the transformed centered position you can use:
var transformedCenter = modelVisual3D.Transform.Transform(sphereVisual3D.CenterPosition);
Note that transformation are hierarchical - so you can have a hierarchy of objects - for example:
ModelVisual3D
ModelVisual3D
SphereVisual3D
BoxVisual3D
So if you apply the transformation to the first ModelVisual3D this will transform all child objects, but CenterPosition on SphereVisual3D and BoxVisual3D will not change - the values of those properties are defined in the local coordinate system (and not in world coordinate system).
You have two options:
1) instead of applying a TranslatTransform3D on the SphereVisual3D, you can just change the value of the CenterPosition.
2) to get the transformed centered position you can use:
var transformedCenter = modelVisual3D.Transform.Transform(sphereVisual3D.CenterPosition);
Note that transformation are hierarchical - so you can have a hierarchy of objects - for example:
ModelVisual3D
ModelVisual3D
SphereVisual3D
BoxVisual3D
So if you apply the transformation to the first ModelVisual3D this will transform all child objects, but CenterPosition on SphereVisual3D and BoxVisual3D will not change - the values of those properties are defined in the local coordinate system (and not in world coordinate system).
Andrej Benedik

