paulsouthport Posted September 9, 2015 Share Posted September 9, 2015 Evening all I'm playing with Google Cardboard using the VRDeviceOrientationFreeCameraI'm wondering if anyone knows the best way to create a move function so that the camera is always moving forward in the direction of the camera (the camera rotation is from the head movement)? thanksPaul Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 9, 2015 Share Posted September 9, 2015 Hi Paul, to do that you will have to calculate the camera's direction (using its target and current position) and update its position. I created a very simple playground that shows how (I guess there are other ways, but i find this the easiest to understand).http://www.babylonjs-playground.com/#WB2TNYou can see I scaled the direction - this would be the "speed" of the camera. Quote Link to comment Share on other sites More sharing options...
paulsouthport Posted September 9, 2015 Author Share Posted September 9, 2015 Excellent, thanks Raanan, that works nicely. 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.