KramSurfer Posted April 21, 2017 Share Posted April 21, 2017 I have a web application that has a 'gaze selector' which is working fine, but I want to have the menus change context when the user is looking at higher X rotation value. When testing on the desktop the standard FreeCamera has rotation values which I can easily check. Then attaching a DeviceOrientiation camera, those rotation values are no longer updated. How can I get the simple rotation values of the DeviceOrientationCamera or VRDeviceOrientationCamera? Pulling my hair out here! Thanks. Keith R Morrison Edit: It appears scene.activeCamera.getWorldMatrix(); is changing value while moving the device. Is there a function to convert this to a x,y,z rotation? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 21, 2017 Share Posted April 21, 2017 Hello deviceOrientationCamera uses quaternions: https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/babylon.deviceOrientationCamera.ts#L22 You can get euler angles from quaternion with this: https://github.com/BabylonJS/Babylon.js/blob/master/src/Math/babylon.math.ts#L2561 Quote Link to comment Share on other sites More sharing options...
KramSurfer Posted April 21, 2017 Author Share Posted April 21, 2017 Thank you. Thank you. Thank you! From the Forums I see you're a big part of BabylonJS. I want to also say THANKS for you efforts in this. I'm new to the engine ( coming from Flash & Flare3D, run in installable AIR applications ) and this engine is very well thought out. I'm excited to create applications using this tech. Keith R Morrison davrous 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 25, 2017 Share Posted April 25, 2017 Thanks Keith I appreciate the feedback! 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.