Click or drag to resize
AB4D logo

ModelUtilsCenterAndScaleModel3D Method

CenterAndScaleModel3D method translates and scales the model3D so that its center is at the centerPosition and that it will fit into the Size3D defined by finalSize.

Namespace: Ab3d.Utilities
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public static void CenterAndScaleModel3D(
	Model3D model3D,
	Point3D centerPosition,
	Size3D finalSize,
	bool preserveAspectRatio = true,
	bool preserveCurrentTransformation = true
)

Parameters

model3D  Model3D
Model3D to center and scale
centerPosition  Point3D
Point3D that specifies the new center position of the model3D
finalSize  Size3D
Size3D that specifies the new size of the model3D (if preserveAspectRatio is true, then min scale will be used to fit the model into the size)
preserveAspectRatio  Boolean  (Optional)
if true, then the scale is uniform (using the min required scale to fit the model into finalSize)
preserveCurrentTransformation  Boolean  (Optional)
if true, then the translate and scale transform are added to the existing transform.
See Also