Reputation:
How can i get the new bounds after applying a translation transform to a WPF mesh geometry 3D?
Upvotes: 2
Views: 2027
Reputation: 137128
As you're just applying a translation you can just apply that translation to the bounds of the geometry, so your solution is correct. It's a rigid transform so each part of the mesh will keep its relative positions to all other parts of the mesh.
In fact this is true of rotation, scale and even skew transformations too. You only have to recalculate the bounds if you deform the mesh.
Upvotes: 0
Reputation:
What I found:
Rect3D newRec3D = modelVisual3D.Transform.TransformBounds(modelVisual3D.Geometry.Bounds);
If you have better way, please post it.
Upvotes: 4