{"action":"closed","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/1011","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/1011/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/1011/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/1011/events","html_url":"https://github.com/mrdoob/three.js/issues/1011","id":2710418,"number":1011,"title":"Camera path","user":{"login":"darkbrain-fc","id":1301055,"avatar_url":"https://avatars.githubusercontent.com/u/1301055?v=3","gravatar_id":"","url":"https://api.github.com/users/darkbrain-fc","html_url":"https://github.com/darkbrain-fc","followers_url":"https://api.github.com/users/darkbrain-fc/followers","following_url":"https://api.github.com/users/darkbrain-fc/following{/other_user}","gists_url":"https://api.github.com/users/darkbrain-fc/gists{/gist_id}","starred_url":"https://api.github.com/users/darkbrain-fc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkbrain-fc/subscriptions","organizations_url":"https://api.github.com/users/darkbrain-fc/orgs","repos_url":"https://api.github.com/users/darkbrain-fc/repos","events_url":"https://api.github.com/users/darkbrain-fc/events{/privacy}","received_events_url":"https://api.github.com/users/darkbrain-fc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mrdoob/three.js/labels/Question","name":"Question","color":"dad9ff"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2012-01-03T13:36:27Z","updated_at":"2015-09-03T04:43:13Z","closed_at":"2015-09-03T04:43:13Z","body":"Hi all,\r\n   i'm trying to understand how camera path works. For now it should be enough to spin around a cube constantly looking at it, but i have two problems. I can't spin around the cube, my camera doesn't walks through all my waypoints, it's seems to stop at the middle (maybe i need more controls path?), and the camera.lookAt(cube.position) seems to do something else (may i totally miss understand it), here's the code:\r\n\r\n```javascript\r\nif ( ! Detector.webgl ) Detector.addGetWebGLMessage();\r\nvar container, stats;\r\nvar camera, scene, renderer, dummy_camera;\r\nvar mesh, mesh2, mesh3, light, cube;\r\nvar mouseX = 0, mouseY = 0;\r\nvar windowHalfX = window.innerWidth / 2;\r\nvar windowHalfY = window.innerHeight / 2;\r\nvar clock = new THREE.Clock();\r\n\r\ninit();\r\nanimate();\r\n\r\nfunction init() {\r\n\tcontainer = document.getElementById( 'container' );\r\n\tscene = new THREE.Scene();\r\n\tcamera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 10000 );\r\n\tcontrols = new THREE.PathControls( camera );\r\n\r\n\tcontrols.waypoints = [ [ 0, 0, 1000 ], [ 200, 0, 0 ], [ 0, 0, -1000 ], [-200,0,0], [ 0, 0, 1000 ] ];\r\n\tcontrols.duration = 14;\r\n\tcontrols.createDebugPath = true;\r\n\tcontrols.createDebugDummy = true;\r\n\tcontrols.lookVertical = false;\r\n\tcontrols.lookHorizontal = false;\r\n\tcontrols.lon = 180;\r\n\tcontrols.useConstantSpeed = true;\r\n\tcontrols.lookSpeed = 0.06;\r\n\tcontrols.verticalAngleMap = { srcRange: [ 0, 2 * Math.PI ], dstRange: [ 1.1, 3.8 ] };\r\n\tcontrols.horizontalAngleMap = { srcRange: [ 0, 2 * Math.PI ], dstRange: [ 0.3, Math.PI - 0.3 ] };\t\t\t\t\r\n\r\n\tcontrols.init();\r\n\tscene.add( controls.animationParent );\r\n\r\n\tlight = new THREE.DirectionalLight( 0xffffff );\r\n\tlight.position.set( 0, 0, 1 ).normalize();\r\n\tscene.add( light );\r\n\r\n\tlight = new THREE.AmbientLight( 0x222222 );\r\n\tscene.add( light );\r\n\r\n\tcube = new THREE.Mesh( new THREE.CubeGeometry( 60, 60, 60 ), new THREE.MeshNormalMaterial( { shading: THREE.SmoothShading } ) );\r\n\tcube.position.x = 0;\r\n\tcube.position.y = 0;\r\n\tcube.position.z = 0;\r\n\r\n\tscene.add( cube );\r\n\r\n\trenderer = new THREE.WebGLRenderer( { antialias: true } );\r\n\trenderer.setSize( window.innerWidth, window.innerHeight );\r\n\r\n\tcontainer.appendChild( renderer.domElement );\r\n\r\n\tstats = new Stats();\r\n\tstats.domElement.style.position = 'absolute';\r\n\tstats.domElement.style.top = '0px';\r\n\tcontainer.appendChild( stats.domElement );\r\n\r\n\tcontrols.animation.play( true, 0 );\r\n}\r\n\r\nfunction animate() {\r\n\trequestAnimationFrame( animate );\r\n\trender();\r\n\tstats.update();\r\n}\r\n\r\nfunction render() {\r\n\tvar delta = clock.getDelta();\r\n\r\n\tTHREE.AnimationHandler.update( delta );\r\n\tcontrols.update( delta );\r\n\tcamera.lookAt( cube.position );\r\n\trenderer.render( scene, camera );\r\n\r\n}\r\n```\t\r\n\r\ntnx,\r\n   DarkBrain"}}