# Rotate object using another object's axis

**URL:** <https://discourse.threejs.org/t/rotate-object-using-another-objects-axis/78878>\
**Category:** Questions\
**Tags:** animation\
**Created:** [March 2, 2025, 11:39pm UTC](https://discourse.threejs.org/t/rotate-object-using-another-objects-axis/78878 "2025-03-02T23:39:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Petralla](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/petralla/32/57298_2.png) [@Petralla](https://discourse.threejs.org/u/Petralla)\
**Post date:** [March 2, 2025, 11:39pm UTC](https://discourse.threejs.org/t/rotate-object-using-another-objects-axis/78878/1 "2025-03-02T23:39:59Z")

</div>

I want to rotate an object in the same direction as another object, but the reference object is already rotated.

Hard to explain \>.\<

I have Object1 and Object2:

- Object1.rotation.set( -0.5, 0, 0.3 );
- Objetc2.rotation.set( 0, 0, 0 );
- Object1.rotation.x += 0.05;

Now, I want to add that Object2 rotates in the direction that Object1 rotates, that is, diagonally.  
Something like this:

 ![A](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/f/6/f6b29bf3257f22f68d258da104dca249b8562dcd.png)

Object2 should look something like this:

 ![B](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/1/3/13fd6423b9cd315a30cd861cc157f6d293fa203d.png)

More information: Object2 is a bone, so it is not possible to add it to a group or something similar.  
Both objects are in the same position (0,0,0).

Thanks for any advice!

---

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [March 3, 2025, 12:05am UTC](https://discourse.threejs.org/t/rotate-object-using-another-objects-axis/78878/2 "2025-03-03T00:05:33Z")

</div>

> [@Petralla](#):
>
> […] I want to rotate an object in the same direction as another object, but the reference object is already rotated. […]

Do you mean something like ([docs](https://threejs.org/docs/index.html?q=objec#api/en/core/Object3D.getWorldDirection)):

```js
const target = new THREE.Vector3();

object1.getWorldDirection(target);
object2.lookAt(target);

```

🤔

---

<div class="post-metadata">

**Author:** ![Petralla](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/petralla/32/57298_2.png) [@Petralla](https://discourse.threejs.org/u/Petralla)\
**Post date:** [March 3, 2025, 12:33am UTC](https://discourse.threejs.org/t/rotate-object-using-another-objects-axis/78878/3 "2025-03-03T00:33:19Z")

</div>

Nope, lookAt is for copy positions, right?

I try this:

 ![C](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/a/a/aaff3897e9219118f1784bd8f94acbdaa21bb5c7.png)

The bone is 0,0,0, but i want to rotate in red line (X axis from other object)

Basically moving elbow to bring it to shoulder 😅

Tanks for reply!!!

---

<div class="post-metadata">

**Author:** ![dubois](https://avatars.discourse-cdn.com/v4/letter/d/e9c0ed/32.png) [@dubois](https://discourse.threejs.org/u/dubois)\
**Post date:** [March 3, 2025, 12:33am UTC](https://discourse.threejs.org/t/rotate-object-using-another-objects-axis/78878/4 "2025-03-03T00:33:35Z")

</div>

I think they just want to add object2 to object1

---

<div class="post-metadata">

**Author:** ![Petralla](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/petralla/32/57298_2.png) [@Petralla](https://discourse.threejs.org/u/Petralla)\
**Post date:** [March 3, 2025, 12:35am UTC](https://discourse.threejs.org/t/rotate-object-using-another-objects-axis/78878/5 "2025-03-03T00:35:55Z")

</div>

I can’t add a bone from one mesh to another mesh or group… or can I? 🤔

Thanks for reply!

---

<div class="post-metadata">

**Author:** ![manthrax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/manthrax/32/2596_2.png) [@manthrax](https://discourse.threejs.org/u/manthrax)\
**Post date:** [March 3, 2025, 5:00am UTC](https://discourse.threejs.org/t/rotate-object-using-another-objects-axis/78878/6 "2025-03-03T05:00:35Z")

</div>

Yes you can. Also highly recommend you check out the difference between .add and .attach.  
.attach is really useful in scenarios like this, because if you need to rotate, say… a bone, around some arbitrary objects frame, you can object.attach( bone ), rotate the object… then .attach the bone back to its previous parent when you’re done.

---

<div class="post-metadata">

**Author:** ![Petralla](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/petralla/32/57298_2.png) [@Petralla](https://discourse.threejs.org/u/Petralla)\
**Post date:** [March 3, 2025, 5:15am UTC](https://discourse.threejs.org/t/rotate-object-using-another-objects-axis/78878/7 "2025-03-03T05:15:27Z")

</div>

Yes!! i attach bone and works! thanks!!!
