# How do I have my obj loaded properly centered at 0,0,0 and scaled?

**URL:** <https://forum.babylonjs.com/t/how-do-i-have-my-obj-loaded-properly-centered-at-0-0-0-and-scaled/21093>\
**Category:** Questions\
**Created:** [May 25, 2021, 5:23am UTC](https://forum.babylonjs.com/t/how-do-i-have-my-obj-loaded-properly-centered-at-0-0-0-and-scaled/21093 "2021-05-25T05:23:14Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![trusktr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/trusktr/32/840_2.png) [@trusktr](https://forum.babylonjs.com/u/trusktr)\
**Post date:** [July 28, 2023, 7:35pm UTC](https://forum.babylonjs.com/t/how-do-i-have-my-obj-loaded-properly-centered-at-0-0-0-and-scaled/21093/16 "2023-07-28T19:35:31Z")

</div>

Here’s a function to center mesh content in a node:

> [@Mesh not importing in the center of scene](https://forum.babylonjs.com/t/mesh-not-importing-in-the-center-of-scene/10383/5):
>
> Here’s a function to center mesh content in a node: function centerMeshContent(node: TransformNode) { const { min, max } = node.getHierarchyBoundingVectors(); const halfRange = max.subtract(min).scaleInPlace(0.5); const currentCenter = min.add(halfRange); const offset = currentCenter.negate(); traverseNodes(node, (n) =\> { if (n instanceof Mesh) { n.position.addInPlace(offset); // The bounding box is world-…

---

_[View the full topic](https://forum.babylonjs.com/t/how-do-i-have-my-obj-loaded-properly-centered-at-0-0-0-and-scaled/21093)._
