cstfan Posted November 3, 2018 Share Posted November 3, 2018 Hi, I would like when I start the device orientation camera that the orientation is as a real world? For example, if I create 4 cubes around me with north, east, west and south, I want to see the north cube when my smartphone is facing north. Thank you very much in advance for your help. Stephan Quote Link to comment Share on other sites More sharing options...
boucher Posted November 4, 2018 Share Posted November 4, 2018 I think you would have to build in your own compass to stay oriented to the real world. It looks like it can already be done on Android, but don't hold your breath for Apple PWA support: https://caniuse.com/#feat=deviceorientation https://caniuse.com/#feat=gyroscope https://caniuse.com/#feat=magnetometer https://caniuse.com/#feat=accelerometer Quote Link to comment Share on other sites More sharing options...
cstfan Posted November 4, 2018 Author Share Posted November 4, 2018 Thank you for your feedback and research track, but I would have liked a solution directly with Babylon because I am not yet very comfortable with javascript. I went through the forum and the playground without success: -( It is to create a POC to help our students find important places in the school. This may not yet be possible with the current version of Babylon, @Deltakosh Can you tell me if there's a solution I may have missed? Thank you and sorry for the inconvenience. Quote Link to comment Share on other sites More sharing options...
ssaket Posted November 5, 2018 Share Posted November 5, 2018 Well, it's not possible without accessing the phone's sensors. There's some extra work that you have to put in, first go through http://docs.phonegap.com/en/edge/cordova_compass_compass.md.html, and then copy paste the demo scene code. Then package your app and it's done ! or wait for some days, I'll may publish the code here Quote Link to comment Share on other sites More sharing options...
Guest Posted November 5, 2018 Share Posted November 5, 2018 We offer the DeviceOrientationCamera to support phone sensors. Then you need to setup your scene and position the camera initially in the good direction: http://doc.babylonjs.com/api/classes/babylon.deviceorientationcamera The complex part in your code would be the initial setup (You could perhaps setup the phone to start facing north or something) Quote Link to comment Share on other sites More sharing options...
cstfan Posted November 6, 2018 Author Share Posted November 6, 2018 Thank you very much for your quick feedback @Deltakosh , I will indeed do as you say, it's already great. Your framework is really great. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted November 6, 2018 Share Posted November 6, 2018 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.