vujadin / BabylonHx

Port of Babylon.js 3D engine to Haxe.
http:/paradoxplay.com/babylonhx
Apache License 2.0
189 stars 43 forks source link

Device Orientation Camera (mobile target) #136

Open tranlong021988 opened 7 years ago

tranlong021988 commented 7 years ago

Hi. I'm planning to do an experience test with Babylonhx, I realize that there are no device orientation event implement from javascript to haxe (alpha beta gamma output), not sure if there are any solution for this case. I'm planning to do a trick, using webview to output device orientation with values to openfl, but current webview extension not support rendering webview at background layer. So do you have another trick ? Sorry for my poor English.

vujadin commented 7 years ago

I'm not sure if you're talking about device orientation or accelerometer. Do you need this maybe http://docs.openfl.org/openfl/sensors/Accelerometer.html http://docs.openfl.org/openfl/events/AccelerometerEvent.html?

On Thu, Dec 1, 2016 at 4:04 PM, tranlong021988 notifications@github.com wrote:

Hi. I'm planning to do an experience test with Babylonhx, I realize that there are no device orientation event implement from javascript to haxe (alpha beta gamma output), not sure if there are any solution for this case. I'm planning to do a trick, using webview to output device orientation with values to openfl, but current webview extension not support rendering webview at background layer. So do you have another trick ? Sorry for my poor English.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vujadin/BabylonHx/issues/136, or mute the thread https://github.com/notifications/unsubscribe-auth/AEbKmXn-ig4CCKIyxQOkrnItd0mjDJvSks5rDuIRgaJpZM4LBfvX .

tranlong021988 commented 7 years ago

hi, AccelerometerEvent has acceleration (X,Y,Z) only, not device rotation. I want to get 3d angles number (alpha, beta, gamma) to input to Camera, which is available in Babylon DeviceOrientationCamera (JS version). For native mobile target, it seem not worked .
Since native mobile performance is the best, if we can find out solution for this then this is an amazing way to build mobile VR application/game.

vujadin commented 7 years ago

I guess you could write openfl/lime extension for android and ios to get what you need. You should talk about that with openfl authors, maybe ask about this on openfl forum

tranlong021988 commented 7 years ago

well, it's seem to be the best option for now without switching to JS solution. Thank you.