hfeist Posted October 12, 2016 Share Posted October 12, 2016 I am trying to capture a FreeCamera's location and pan angle or rotation so I can reposition the camera later with the exact same view. (I am working with the playGround Collision example) I seem to be able to get camera.position.x, camera.position.y and camera.position.z ok but camera.cameraRotation.y just yields zero every time Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 12, 2016 Share Posted October 12, 2016 Hey just check camera.rotation Quote Link to comment Share on other sites More sharing options...
hfeist Posted October 12, 2016 Author Share Posted October 12, 2016 Thanks, works great! Of course now I'm stuck trying to set the camera postion to the values I've collected. Just setting them simple-mindedly like so doesn't work: camera.position.x=firstX; camera.position.y=firstY; camera.position.z=firstZ; camera.rotation.y=firstR; Quote Link to comment Share on other sites More sharing options...
hfeist Posted October 12, 2016 Author Share Posted October 12, 2016 I've also tried camera.position = new BABYLON.Vector3(firstX, firstY, firstZ); and camera.position = new BABYLON.Vector3(-0.6, -4, 5).addInPlace(new BABYLON.Vector3(firstX, firstY, firstZ)); but the position doesn't change Quote Link to comment Share on other sites More sharing options...
hfeist Posted October 12, 2016 Author Share Posted October 12, 2016 I was wrong. We were having db maintenance going on and my positions weren't being saved. I can now get the camera to return to the saved x,y and z positions and the rotation works as well just by setting the camera.rotation.y to the saved value. Now if I could save and retrieve the tilt angle of the camera I'd just about have things working perfectly. Thanks so much for the help! Quote Link to comment Share on other sites More sharing options...
hfeist Posted October 14, 2016 Author Share Posted October 14, 2016 I'm a little slow: I can get the tilt angle by also checking the camera.rotationx and camera.rotation.z values 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.