Click or drag to resize
AB4D logo

MeshUtilsPositionAndScaleMeshGeometry3D Method

PositionAndScaleModel3D method translates and scales the model3D so that it is positioned according to position and positionType parameters and that it will fit into the Size3D defined by finalSize parameter.

Namespace: Ab3d.Utilities
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
public static MeshGeometry3D PositionAndScaleMeshGeometry3D(
	MeshGeometry3D mesh,
	Point3D position,
	PositionTypes positionType,
	Size3D finalSize,
	bool preserveAspectRatio = true,
	bool transformNormals = true


mesh  MeshGeometry3D
MeshGeometry3D that is transformed
position  Point3D
Point3D that specifies position of the model3D
positionType  PositionTypes
type of position
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)
transformNormals  Boolean  (Optional)
if true (by default) the normals are transformed with inverted and transposed transform matrix; if false normals are not transformed and are copied from original MeshGeometry3D

Return Value

new MeshGeometry3D that is positioned and scaled according to the method parameters
See Also