# Rotate gltf model around custom axis

**URL:** <https://discourse.threejs.org/t/rotate-gltf-model-around-custom-axis/17476>\
**Category:** Questions\
**Tags:** gltf-loader, loaders, geometry\
**Created:** [July 28, 2020, 4:42pm UTC](https://discourse.threejs.org/t/rotate-gltf-model-around-custom-axis/17476 "2020-07-28T16:42:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikolas\_GameOver](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nikolas_gameover/32/12209_2.png) [@Nikolas\_GameOver](https://discourse.threejs.org/u/Nikolas_GameOver)\
**Post date:** [July 28, 2020, 4:42pm UTC](https://discourse.threejs.org/t/rotate-gltf-model-around-custom-axis/17476/1 "2020-07-28T16:42:46Z")

</div>

Hi! Total noob here , I have been trying for weeks to rotate my gltf model around a custom pivot point to no avail. Methods I used were creating a group, then adding loaded gltf models to that group and then trying to rotate the group itself to no avail. Then adding a sphere geometry then adding the pivotpoint to the mesh and then the loaded model to the pivotpoint to no avail. Everything I try produces no errors, but just doesn’t move around like it should. I also debugged the rotation of the model in my console and it does seem to change but I just can’t get movement. However any rotation I tried around the models own axis works. So I think I am missing something as far as geometries or meshes of imported models is concerned.

This [https://codepen.io/vidark/pen/oWZEQJ](https://codepen.io/vidark/pen/oWZEQJ) is the action I am trying to replicate but with gltf custom models instead of spheres. I even managed to replace the spheres with gltf models but they were immovable too.

This is one is one of my many fails : [https://codepen.io/stial\_dmg/pen/pogmVoR](https://codepen.io/stial_dmg/pen/pogmVoR)

Any help would be hugely appreciated. Thanks!!

---

<div class="post-metadata">

**Author:** ![hofk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hofk/32/44944_2.png) [@hofk](https://discourse.threejs.org/u/hofk)\
**Post date:** [July 28, 2020, 7:10pm UTC](https://discourse.threejs.org/t/rotate-gltf-model-around-custom-axis/17476/2 "2020-07-28T19:10:31Z")

</div>

You can try it in modification of the example from the [Collection of examples from discourse.threejs.org](https://discourse.threejs.org/t/collection-of-examples-from-discourse-threejs-org/4315) 2020.

See [https://hofk.de/main/discourse.threejs/2020/index2020.html](https://hofk.de/main/discourse.threejs/2020/index2020.html)

![2020-07-28 21.07.37](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/5/57aa1b4ddf6617f788c4d039f630b2ae96b12431.png)

Just define suitable rotations with sin/cos.

---

<div class="post-metadata">

**Author:** ![Nikolas\_GameOver](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nikolas_gameover/32/12209_2.png) [@Nikolas\_GameOver](https://discourse.threejs.org/u/Nikolas_GameOver)\
**Post date:** [July 28, 2020, 7:39pm UTC](https://discourse.threejs.org/t/rotate-gltf-model-around-custom-axis/17476/3 "2020-07-28T19:39:34Z")

</div>

hofk , thank you so much ! I had seen your example long ago but my mind was so locked on the rotation aspect that I never thought I could just modify the actual position of the object to then represent a full rotation! Thanks again, appreciate it.

---

<div class="post-metadata">

**Author:** ![hofk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hofk/32/44944_2.png) [@hofk](https://discourse.threejs.org/u/hofk)\
**Post date:** [July 28, 2020, 7:42pm UTC](https://discourse.threejs.org/t/rotate-gltf-model-around-custom-axis/17476/4 "2020-07-28T19:42:34Z")

</div>

You are welcome 🍻
