# Issue placing the ground just under the mesh, using boundingBoxInfo

**URL:** <https://forum.babylonjs.com/t/issue-placing-the-ground-just-under-the-mesh-using-boundingboxinfo/27761>\
**Category:** Questions\
**Created:** [February 17, 2022, 6:59pm UTC](https://forum.babylonjs.com/t/issue-placing-the-ground-just-under-the-mesh-using-boundingboxinfo/27761 "2022-02-17T18:59:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tynail](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tynail/32/17666_2.png) [@tynail](https://forum.babylonjs.com/u/tynail)\
**Post date:** [February 17, 2022, 6:59pm UTC](https://forum.babylonjs.com/t/issue-placing-the-ground-just-under-the-mesh-using-boundingboxinfo/27761/1 "2022-02-17T18:59:09Z")

</div>

Hi everyone,

Hope everyone have a great Thursday!

I am trying to position a ground under a mesh using the getBoundingBox info. But no matter what value I use for the position the ground never move and I dont understand why.

When my mesh is not scaled I have no issue but with a scale of 1000 the position never change.

PG:[https://playground.babylonjs.com/#4F33I3#420](https://playground.babylonjs.com/#4F33I3#420)

---

<div class="post-metadata">

**Author:** ![ecoin](https://avatars.discourse-cdn.com/v4/letter/e/8e7dd6/32.png) [@ecoin](https://forum.babylonjs.com/u/ecoin)\
**Post date:** [February 17, 2022, 7:08pm UTC](https://forum.babylonjs.com/t/issue-placing-the-ground-just-under-the-mesh-using-boundingboxinfo/27761/2 "2022-02-17T19:08:07Z")

</div>

Your **boundingBoxY** calculation is half the difference between the maximum and minimum world coords of the sphere, which results to its center position. So no matter how you scale it, the ground will remain the the center of the sphere, because by default Babylon scales from the center.

---

<div class="post-metadata">

**Author:** ![tynail](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tynail/32/17666_2.png) [@tynail](https://forum.babylonjs.com/u/tynail)\
**Post date:** [February 17, 2022, 7:18pm UTC](https://forum.babylonjs.com/t/issue-placing-the-ground-just-under-the-mesh-using-boundingboxinfo/27761/3 "2022-02-17T19:18:05Z")

</div>

In this case why with the same playground with the scaling code commented the ground is positioned where I want.  
PG: [https://playground.babylonjs.com/#4F33I3#421](https://playground.babylonjs.com/#4F33I3#421)

---

<div class="post-metadata">

**Author:** ![tynail](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tynail/32/17666_2.png) [@tynail](https://forum.babylonjs.com/u/tynail)\
**Post date:** [February 17, 2022, 7:23pm UTC](https://forum.babylonjs.com/t/issue-placing-the-ground-just-under-the-mesh-using-boundingboxinfo/27761/4 "2022-02-17T19:23:57Z")

</div>

in other words, is there a way to always position the mesh at the extremity of the bounding box no matter what the scale is?

---

<div class="post-metadata">

**Author:** ![ecoin](https://avatars.discourse-cdn.com/v4/letter/e/8e7dd6/32.png) [@ecoin](https://forum.babylonjs.com/u/ecoin)\
**Post date:** [February 17, 2022, 7:28pm UTC](https://forum.babylonjs.com/t/issue-placing-the-ground-just-under-the-mesh-using-boundingboxinfo/27761/5 "2022-02-17T19:28:21Z")

</div>

It’s because without scaling, (1 - -1) / 2 = 1 which happens to be at the top of the sphere.

> [@tynail](#):
>
> always position the mesh at the extremity of the bounding box

Depends on what side of the bounding box you want, [here is example](https://playground.babylonjs.com/#4F33I3#423).

---

<div class="post-metadata">

**Author:** ![tynail](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tynail/32/17666_2.png) [@tynail](https://forum.babylonjs.com/u/tynail)\
**Post date:** [February 17, 2022, 7:31pm UTC](https://forum.babylonjs.com/t/issue-placing-the-ground-just-under-the-mesh-using-boundingboxinfo/27761/6 "2022-02-17T19:31:49Z")

</div>

It’s because without scaling, (1 - -1) / 2 = 1 which happens to be at the top of the sphere. → Haaa now I see it make a lot of sense!

I think this piece of code → sphere.computeWorldMatrix(true)  
Is really what I was missing in my project.  
Thank you very much!

---

<div class="post-metadata">

**Author:** ![ecoin](https://avatars.discourse-cdn.com/v4/letter/e/8e7dd6/32.png) [@ecoin](https://forum.babylonjs.com/u/ecoin)\
**Post date:** [February 17, 2022, 7:33pm UTC](https://forum.babylonjs.com/t/issue-placing-the-ground-just-under-the-mesh-using-boundingboxinfo/27761/7 "2022-02-17T19:33:10Z")

</div>

> [@tynail](#):
>
> I think this piece of code → sphere.computeWorldMatrix(true)  
> Is really what I was missing in my project.

I know, it’s a little gem lost/never written in the doc, discovered this myself the hard way.
