rockfish Posted October 9, 2015 Share Posted October 9, 2015 I'm trying to develop a globe in three.js. Pretty much got everything I want working but I'm have trouble getting a camera to rotate from one position to another when I click a button. I know that the cordinates are correct because if I use some simple code the camera jumps to the new position when I do this camera.position.set(posX,posY,posZ);camera.lookAt(new THREE.Vector3(0,0,0)); So give that my destination is correct I struggling to understand why the following function that uses tween.js doesn't work. I'd appreciate any help as I'm really struggling with this 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(); Many thanks Quote Link to comment Share on other sites More sharing options...
viktorapo Posted January 3, 2016 Share Posted January 3, 2016 Hey, I'm struggling with the same prob. Did you find a solution? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.