EddyVerbruggen / nativescript-ar

Augmented Reality NativeScript plugin
https://www.nativescript.org/blog/preview-of-augmented-reality-in-nativescript
MIT License
118 stars 36 forks source link

Replace our custom Android lib (using ARCore) by Sceneform (and get the Android impl on par with iOS) #37

Closed EddyVerbruggen closed 4 years ago

EddyVerbruggen commented 5 years ago

Sceneform is a relatively new abstraction layer on top of ARCore. It doesn't require (plugin) developers to directly interact with OpenGL, which I needed to do previously (hence the embedded custom native library I created).

This hampered progress enormously because of the long development-build-test cycle it caused.

With Sceneform the Android API's are a lot like the iOS ARKit API's so let's use Sceneform and then get the Android implementation on par with iOS.

Generic tasks:

Port iOS features to Android

More demos

nickolanack commented 5 years ago

awesome work!!!

I was also wondering if it makes sense to use a single origin anchor for new items (I believe it is more efficient to share anchors if possible) unless they are attached to a surface anchor... thoughts?

I was hoping to support options.parentNode for add* which would make sense in the solar system example for instance (https://developers.google.com/ar/develop/java/sceneform/samples)

I'd also like to add support for a new node type 'ARUIView' or something like that which could render nativescript ui components in a panel in 3D i've successfully done this in android and it should be possible in ios

EddyVerbruggen commented 5 years ago

Hey @nickolanack, really happy with your contributions and ideas!

Please go ahead and try a few things, and once you're happy feel free to create a PR from your fork or push directly to master (make sure you don't break backward compatibility for iOS).

Regarding an ARUIView: I was thinking the same and experimented with it on Android last weekend. It seemed to work, but was a bit hacky. And I would be really interested if something similar is possible on iOS. My approach was to define some markup like this and add it to the AR scene like this. That switch actually fires the onTap="tapp" method when toggled in AR so as a PoC it works great, but code-wise it's a bit hacky.

nickolanack commented 5 years ago

I've also created branches for addTube (although it is just a cylinder) and a branch for addUIView which will display nativescript ui content although at the moment just Hello World text

I don't want to PR any more until you've had a chance to review the current PR and make sure I'm not going off in the wrong direction...

I also need to get my hands on an iphone to work on addUIView for ios

EddyVerbruggen commented 4 years ago

This is now mostly done, with many thanks to @nickolanack!

Not everything is perfect yet, but it's so much better than before. It needs more testing and maybe more demos (and certainly documentation) - I'm aiming for a 1.0.0 release somewhere next month.