BabylonHx icon indicating copy to clipboard operation
BabylonHx copied to clipboard

Device Orientation Camera (mobile target)

Open tranlong021988 opened this issue 9 years ago • 4 comments

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.

tranlong021988 avatar Dec 01 '16 15:12 tranlong021988

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 [email protected] 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 .

vujadin avatar Dec 01 '16 21:12 vujadin

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.

tranlong021988 avatar Dec 02 '16 08:12 tranlong021988

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

vujadin avatar Dec 02 '16 19:12 vujadin

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

tranlong021988 avatar Dec 08 '16 09:12 tranlong021988