react-native-arkit icon indicating copy to clipboard operation
react-native-arkit copied to clipboard

Examples

Open hackable opened this issue 7 years ago • 8 comments

Thanks for your effort in putting the ARKit library for React Native can you please include some example of rendering an object or image would be very helpful.

hackable avatar Jul 12 '17 18:07 hackable

Thank you for your suggestion! I'm trying to connect RN and the iOS rendering engine SceneKit and just released a new version that you can add a cube into the scene. A simple example is included in the readme. I'm still working on other geometries and will make updates when this is done.

qftgtr avatar Jul 13 '17 11:07 qftgtr

Hey @qftgtr thanks for this awesomeness. With this library, would I be able to achieve something like this: https://www.youtube.com/watch?v=rIPfpGCxONQ with this library? Apologies if this question is not related.

samahndev avatar Jul 13 '17 23:07 samahndev

Hi @samahndev, I am pretty sure that you can achieve almost the same result using RN+ARKit. It requires some extra work to bind RN with the native 3D engine, which is what I'm working on right now. The other thing is you need to have a rather complicated 3D scene as in the video.

qftgtr avatar Jul 14 '17 13:07 qftgtr

@qftgtr Is it possible to use FBX models (with animation) or a Unity scene with this library?

mo-solnet avatar Aug 23 '17 02:08 mo-solnet

Hi @qftgtr A similar question to samahndev - I am wondering if it's possible to combine the example you have with native ARKit code? I know I can call a custom native module and pass control to native hence, but if at that point I use ARKit directly then wouldn't I end up having multiple ARSessions? Would that work? I figured you are instantiating the ARSession in RCTARKit.m

p.s.: Great work - thanks!

aurodatateam avatar Aug 30 '17 02:08 aurodatateam

@aurodatateam i believe that when RCTARKit is instantiated it follows the Singleton pattern. So anywhere you want to access the session, just call (ObjC) [[RCTARKit sharedInstance] session], as session is a property of the RCTARKit object.

From there, you can use all your native code and share the same ARSession.

KjellConnelly avatar Sep 06 '17 05:09 KjellConnelly

has anyone implemented gesture recognizers for this library? I've been trying to expose the following methods but can't get it right...

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { virtualObjectManager.reactToTouchesBegan(touches, with: event, in: self.sceneView) }

override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { if virtualObjectManager.virtualObjects.isEmpty { chooseObject(addObjectButton) return } virtualObjectManager.reactToTouchesEnded(touches, with: event) }

Does anyone have examples of how they implemented these? Thanks!

kristabell avatar Sep 12 '17 22:09 kristabell

@kristabell best use a panresponder and do the gesture stuff in the js code:

https://facebook.github.io/react-native/docs/panresponder.html

macrozone avatar Oct 08 '17 09:10 macrozone