# Control diameter of sphere on the ground

**URL:** <https://forum.babylonjs.com/t/control-diameter-of-sphere-on-the-ground/1334>\
**Category:** Questions\
**Created:** [February 12, 2019, 5:05pm UTC](https://forum.babylonjs.com/t/control-diameter-of-sphere-on-the-ground/1334 "2019-02-12T17:05:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lokamidou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lokamidou/32/2263_2.png) [@Lokamidou](https://forum.babylonjs.com/u/Lokamidou)\
**Post date:** [February 12, 2019, 5:05pm UTC](https://forum.babylonjs.com/t/control-diameter-of-sphere-on-the-ground/1334/1 "2019-02-12T17:05:16Z")

</div>

How to make the sphere on the ground during controlling the diameter on this example [https://www.babylonjs-playground.com/#GX8A2Y](https://www.babylonjs-playground.com/#GX8A2Y) (by each update of values, the sphere has to be on the ground)

---

<div class="post-metadata">

**Author:** ![trevordev](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/trevordev/32/16_2.png) [@trevordev](https://forum.babylonjs.com/u/trevordev)\
**Post date:** [February 12, 2019, 6:12pm UTC](https://forum.babylonjs.com/t/control-diameter-of-sphere-on-the-ground/1334/2 "2019-02-12T18:12:22Z")

</div>

The center of the sphere is it’s position, to workaround this you can either update the position of the sphere to of set this or use a parent node for scaling at the bottom of the sphere.

See: [https://www.babylonjs-playground.com/#GX8A2Y#1](https://www.babylonjs-playground.com/#GX8A2Y#1)

---

<div class="post-metadata">

**Author:** ![Galen](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/galen/32/539_2.png) [@Galen](https://forum.babylonjs.com/u/Galen)\
**Post date:** [February 12, 2019, 6:15pm UTC](https://forum.babylonjs.com/t/control-diameter-of-sphere-on-the-ground/1334/3 "2019-02-12T18:15:46Z")

</div>

I believe you might be overthinking this a bit, although a transform node will do the trick most of the time. However looking at your other post, I see you want to add physics. Here’s the simplest solution:

[https://www.babylonjs-playground.com/#GX8A2Y#2](https://www.babylonjs-playground.com/#GX8A2Y#2)

Galen

---

<div class="post-metadata">

**Author:** ![Lokamidou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lokamidou/32/2263_2.png) [@Lokamidou](https://forum.babylonjs.com/u/Lokamidou)\
**Post date:** [February 21, 2019, 3:52pm UTC](https://forum.babylonjs.com/t/control-diameter-of-sphere-on-the-ground/1334/4 "2019-02-21T15:52:41Z")

</div>

@Galen Why when I am changing the shape to box [https://www.babylonjs-playground.com/#GX8A2Y#4](https://www.babylonjs-playground.com/#GX8A2Y#4) it doesn’t match on the ground? Which postion you think has to be after changing the value of the slider?

---

<div class="post-metadata">

**Author:** ![Galen](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/galen/32/539_2.png) [@Galen](https://forum.babylonjs.com/u/Galen)\
**Post date:** [February 26, 2019, 12:23am UTC](https://forum.babylonjs.com/t/control-diameter-of-sphere-on-the-ground/1334/5 "2019-02-26T00:23:04Z")

</div>

The diameter of a box is not the same as a sphere. I would have to make more attempts, but perhaps this PG scene will show you a bit more.

[https://www.babylonjs-playground.com/#GX8A2Y#6](https://www.babylonjs-playground.com/#GX8A2Y#6)

Galen

---

<div class="post-metadata">

**Author:** ![Galen](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/galen/32/539_2.png) [@Galen](https://forum.babylonjs.com/u/Galen)\
**Post date:** [February 26, 2019, 12:41am UTC](https://forum.babylonjs.com/t/control-diameter-of-sphere-on-the-ground/1334/6 "2019-02-26T00:41:31Z")

</div>

@Lokanath_Bagh

Is this what you’re looking for?

[https://www.babylonjs-playground.com/#GX8A2Y#8](https://www.babylonjs-playground.com/#GX8A2Y#8)

It’s important to understand the transforms of a primitive mesh. It’s all in the math - simple math, that is.

Galen

---

<div class="post-metadata">

**Author:** ![Lokamidou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lokamidou/32/2263_2.png) [@Lokamidou](https://forum.babylonjs.com/u/Lokamidou)\
**Post date:** [February 26, 2019, 9:11am UTC](https://forum.babylonjs.com/t/control-diameter-of-sphere-on-the-ground/1334/7 "2019-02-26T09:11:46Z")

</div>

@Galen yup! I see it’s simple math! thank you:)

---

<div class="post-metadata">

**Author:** ![Lokamidou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lokamidou/32/2263_2.png) [@Lokamidou](https://forum.babylonjs.com/u/Lokamidou)\
**Post date:** [March 9, 2019, 12:06pm UTC](https://forum.babylonjs.com/t/control-diameter-of-sphere-on-the-ground/1334/8 "2019-03-09T12:06:58Z")

</div>

Is it possible to add a dashed lines to show the diameter of the sphere? [https://www.babylonjs-playground.com/#GX8A2Y#9](https://www.babylonjs-playground.com/#GX8A2Y#9)

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [March 9, 2019, 1:52pm UTC](https://forum.babylonjs.com/t/control-diameter-of-sphere-on-the-ground/1334/9 "2019-03-09T13:52:38Z")

</div>

Something like this? [https://www.babylonjs-playground.com/#GX8A2Y#10](https://www.babylonjs-playground.com/#GX8A2Y#10)
