Integration with BabylonReactNative #207
Replies: 9 comments 7 replies
-
hi @AndrewJSchoen I think it will work, but I have not made the time to connect the dots. I'm happy to work with you on this - perhaps you can create a basic repo and I can try to get it working? It should work with Babylon React Native project by following 2 steps:
Anyway, if you can perhaps share a repo then I'm pretty sure we can connect the two and have declarative babylon in Native. I'll start getting everything running on my computer 😄 |
Beta Was this translation helpful? Give feedback.
-
I should add as well that if above doesn't work then I will make any changes to this library (even breaking changes) to make it happen. |
Beta Was this translation helpful? Give feedback.
-
Sounds great. I will work on sharing something later today! |
Beta Was this translation helpful? Give feedback.
-
Even a basic project not currently using |
Beta Was this translation helpful? Give feedback.
-
it doesn't need to run on Expo - that's not how the Babylon React Native project works: If you are trying to run on Expo I think it will be quite complicated and you will not get access to XR hardware. I have looked through the three.js bindings for Expo and it's quite involved. Were you planning to use the regular BabylonReactNative project? |
Beta Was this translation helpful? Give feedback.
-
@AndrewJSchoen I've added to the readme. Also, have posted findings in the forum. Sorry it took so long 😄 Here is the gist: import React, { useState } from 'react';
import { View } from 'react-native';
import { EngineView, useEngine } from '@babylonjs/react-native';
import { Camera } from '@babylonjs/core';
import { EngineCanvasContext, Scene } from 'react-babylonjs';
const EngineScreen: FunctionComponent<ViewProps> = (props: ViewProps) => {
const engine = useEngine();
const [camera, setCamera] = useState<Camera>();
return (
<View style={props.style}>
<EngineCanvasContext.Provider value={{ engine, canvas: null }}>
{engine &&
<Scene>
<arcRotateCamera
name="camera1"
onCreated={camera => setCamera(camera)}
/>
<hemisphericLight name="light1" />
{ /* rest of declarative scene/components here */ }
</Scene>
}
</EngineCanvasContext.Provider>
<EngineView camera={camera} displayFrameRate={true} />
</View>
);
}; |
Beta Was this translation helpful? Give feedback.
-
您好,邮件已收到!我会尽快给您回复。谢谢!Hello, I have received your Email and I'll reply as soon as possible. Thank you very much!
(这是自动回复邮件,以便确认邮件已收到。This is the auto reply to confirm email has been received.)
|
Beta Was this translation helpful? Give feedback.
-
Hmmm!! |
Beta Was this translation helpful? Give feedback.
-
Im waiting information from you,if you could something I will be so
happy,also you can send pictures for your products ,this is my Whatshap
number:+22372752236
…On Fri, 6 Jan 2023 at 16:08 Kashaf Naz ***@***.***> wrote:
Hmmm!!
Sound interesting
let me see if I can help
—
Reply to this email directly, view it on GitHub
<#207 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AX5COYHMC7JAUWVZ2XQ2WH3WRAYORANCNFSM5PRREYOQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Hi all,
I am doing some reconnaissance work to see if BabylonReactNative + react-babylonjs might be an option for a project that we are currently porting to AR on mobile devices. I see that both this library and BabylonReactNative have their own versions of the Engine, and I was wondering if these two libraries could be combined to allow declarative construction on native devices. Given that BabylonReactNative seems to essentially create a sophisticated web view, presumably this should be possible, but I am not yet familiar enough with Babylon to know if the two implementations would play nicely. Any thoughts on this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions