# tween camera movement around globe three.js and tween.js

**URL:** <https://forum.kirupa.com/t/tween-camera-movement-around-globe-three-js-and-tween-js/633866>\
**Category:** Uncategorized\
**Created:** [October 15, 2015, 2:04pm UTC](https://forum.kirupa.com/t/tween-camera-movement-around-globe-three-js-and-tween-js/633866 "2015-10-15T14:04:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BobHaslett](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@BobHaslett](https://forum.kirupa.com/u/BobHaslett)\
**Post date:** [October 15, 2015, 2:04pm UTC](https://forum.kirupa.com/t/tween-camera-movement-around-globe-three-js-and-tween-js/633866/1 "2015-10-15T14:04:42Z")

</div>

I.m trying to get a camera to smoothly rotate around a globe to a new position when a button is pressed. I’be done proof of position with the following to check the coordinates are OK

```
camera.position.set(posX,posY,posZ);
camera.lookAt(new THREE.Vector3(0,0,0));

```

However when I do the following to try to get it to tween nothing happens. Seems the .onupdate isn’t being called and I can’t figure out what I’ve done wrong. I’ve been looking at this for a while now and can’t get it to work and am really struggling.

```
var from = {
        x : camera.position.x,
        y : camera.position.y,
        z : camera.position.z
      };

      var to = {
        x : posX,
        y : posY,
        z : posZ
      };
      var tween = new TWEEN.Tween(from)
      .to(to,600)
      .easing(TWEEN.Easing.Linear.None)
      .onUpdate(function () {
        camera.position.set(this.x, this.y, this.z);
        camera.lookAt(new THREE.Vector3(0,0,0));
      })
      .onComplete(function () {
        camera.lookAt(new THREE.Vector3(0,0,0));
      })
      .start();

```

Any help gratefully received

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [October 16, 2015, 2:55am UTC](https://forum.kirupa.com/t/tween-camera-movement-around-globe-three-js-and-tween-js/633866/2 "2015-10-16T02:55:31Z")

</div>

Hi, Bob!  
Unfortunately, I’m not too familiar with both of these libraries to be able to help you out ☹

As for some troubleshooting steps, does the tween actually apply? In other words, can you see the camera moving to your new position?

Cheers!  
Kirupa
