alurpal Posted March 30, 2017 Share Posted March 30, 2017 Trying to get an ArcRotateCam to follow an object while retaining it's default movement behavior (keyboard and mouse rotation and zoom). I have a simple box that will move to wherever you click on the ground. In this first attempt, the camera will change it's target on click and default movement behavior works: http://www.babylonjs-playground.com/index2_5.html#2ENPZ7#5 Now in this version, I attempted to update the target within a function registered to scene.registerBeforeRender(). The following now works great but I lose all default controls: http://www.babylonjs-playground.com/index2_5.html#2ENPZ7#4 Hoping someone can lead me in the right direction. Thanks! Quote Link to comment Share on other sites More sharing options...
JBP Posted March 30, 2017 Share Posted March 30, 2017 Like this: http://www.babylonjs-playground.com/index2_5.html#2ENPZ7#6 just init camera like this: var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, 1.0, 110, sphere.position, scene); Quote Link to comment Share on other sites More sharing options...
alurpal Posted March 30, 2017 Author Share Posted March 30, 2017 18 minutes ago, JBP said: Like this: http://www.babylonjs-playground.com/index2_5.html#2ENPZ7#6 just init camera like this: var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, 1.0, 110, sphere.position, scene); Wonderfully easy. Thanks! 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.