JCPalmer

emulating WC3 deviceorientation in iOS app?

Recommended Posts

I am doing some comparing of mobile application options.  Thought maybe someone might mention if I am way off in the wrong direction (usually when I start these threads it is more of a conversation with myself :().

As it relates to using either of the deviceorientation cameras in BJS,  the environment must support the 2, orientationchange & deviceorientation, window events.  I cannot seem to get any direct search hits for "WKWebView deviceorientation".  WKWebView  is the iOS class where your html5 is embedded.  I am seeing crosswalk directly supports W3C DeviceOrientation Events, so Android looks good.

I am wondering if using this plugin could be done?  It's callback is just navigator.compass.getCurrentHeading, that can be done on a specified frequency.  It does not look like I could sub-class  babylon.freecamera.input.deviceorientation.ts, but thinking it could be replicated.  Cameras like babylon.deviceOrientationCamera.ts could definitely be sub-classed by changing one line in the constructor, though.

Is this completely insane, because of "..."?

Share this post


Link to post
Share on other sites

Hi @JCPalmer,

the WKWebView is the new web view introduced in iOS 9 (if I am not mistaken). It used to be UIWebView. The WK is actually WebKit, so I would expect the events to be integrated there. But, if they are not, a hack should be implemented :)

I see Cordova has this - https://github.com/apache/cordova-plugin-screen-orientation , which claims that iOS does fire the event. They also have the device orientation plugin which you found.

I don't think it is that insane to create a new camera. I think, however, it will be simpler to implement a functio that triggers the needed events (deviceorientation events) with the needed data to get the device orientation camera working.

This is a very uneducated assumption! but this is what I would try first.

Share this post


Link to post
Share on other sites

I thought it might be a good idea to ask Intel, so I did. They thought it might just work.  Been running around doing xmas stuff today, but did get a web version of a test scene (red, yellow, green, & orange walls), white floor & blue ceiling. 

BTW, can anyone confirm this scene works in android?

Github.io takes a while to build your pages.  I tried Android first, too soon apparently. It works on Android upon refresh.

Share this post


Link to post
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...

  • Recently Browsing   0 members

    No registered users viewing this page.