# Rotation gizmo location for custom mesh

**URL:** <https://forum.babylonjs.com/t/rotation-gizmo-location-for-custom-mesh/32548>\
**Category:** Questions\
**Created:** [July 27, 2022, 3:07pm UTC](https://forum.babylonjs.com/t/rotation-gizmo-location-for-custom-mesh/32548 "2022-07-27T15:07:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![flex](https://avatars.discourse-cdn.com/v4/letter/f/8baadc/32.png) [@flex](https://forum.babylonjs.com/u/flex)\
**Post date:** [July 27, 2022, 3:07pm UTC](https://forum.babylonjs.com/t/rotation-gizmo-location-for-custom-mesh/32548/1 "2022-07-27T15:07:09Z")

</div>

Hi All-

I use baked (world) vertices for my custom meshes which makes using gizmos a little tricky.

What I want to do is have a rotation gizmo whose axis is the center of my mesh. This playground does this by setting the pivot of the mesh to be the center of the bounding box of the mesh and then attaching the gizmo to the mesh.

It works but the gizmo is located at (0,0,0), which makes sense since that’s the position of the mesh transform.

I imagine I can use a transform node to center the gizmo on the mesh but I can’t quite figure out how.

> **[Babylon.js Playground](https://playground.babylonjs.com/#7421MI)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Any thoughts?

Thanks-

Flex

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [July 27, 2022, 3:31pm UTC](https://forum.babylonjs.com/t/rotation-gizmo-location-for-custom-mesh/32548/2 "2022-07-27T15:31:19Z")

</div>

cc @Cedric

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [July 27, 2022, 3:41pm UTC](https://forum.babylonjs.com/t/rotation-gizmo-location-for-custom-mesh/32548/3 "2022-07-27T15:41:17Z")

</div>

I would not do it using pivot but with a bake transform instead:

> **[Babylon.js Playground](https://playground.babylonjs.com/#7421MI%231)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

mesh is moved so its center is on (0,0,0), baked and then translated to move its center at the previous world position.

---

<div class="post-metadata">

**Author:** ![flex](https://avatars.discourse-cdn.com/v4/letter/f/8baadc/32.png) [@flex](https://forum.babylonjs.com/u/flex)\
**Post date:** [July 27, 2022, 4:03pm UTC](https://forum.babylonjs.com/t/rotation-gizmo-location-for-custom-mesh/32548/4 "2022-07-27T16:03:17Z")

</div>

Thanks, Cedric. That makes sense.

I had tried that approach unsuccessfully in my app but I it works in the playground so I’ll go back and figure out why.
