ModelData:getCenter

Edit

Returns the center of the model's axis-aligned bounding box, relative to the model's origin.




Get the center of the whole model.

Arguments

None

Returns

NameTypeDescription
xnumber The x coordinate of the center of the bounding box.
ynumber The y coordinate of the center of the bounding box.
znumber The z coordinate of the center of the bounding box.

Get the center of a single mesh in the model.

Arguments

NameTypeDescription
meshnumber The mesh to get the center of.

Returns

NameTypeDescription
xnumber The x coordinate of the center of the bounding box.
ynumber The y coordinate of the center of the bounding box.
znumber The z coordinate of the center of the bounding box.

Get the center of a single part of a mesh in the model.

Arguments

NameTypeDescription
meshnumber The mesh to get the center of.
partnumber The part to get the center of.

Returns

NameTypeDescription
xnumber The x coordinate of the center of the bounding box.
ynumber The y coordinate of the center of the bounding box.
znumber The z coordinate of the center of the bounding box.

See also