Jump to content

BabylonJS and Google Cardboard


paulsouthport
 Share

Recommended Posts

Evening all

 

I'm playing with Google Cardboard using the VRDeviceOrientationFreeCamera

I'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)?

 

thanks

Paul

 

Link to comment
Share on other sites

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/#WB2TN

You can see I scaled the direction - this would be the "speed" of the camera.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...