giandifra / arcore_flutter_plugin

Flutter plugin for ARCore SDK, Android platform to build new augmented reality experiences
MIT License
431 stars 274 forks source link

What's the next step? #136

Open giandifra opened 3 years ago

giandifra commented 3 years ago

Hi guys,

as you already know Sceneform is archived by Google (the project is open source), so it would be appropriate to decide which way to go in order not to spend too much time (perhaps useless).

In a new branch I have restructured the plugin to be more flexible by bringing new features.

But before spending some time improving the new branch or the master (null safety, bug fix etc) I wanted to consider with you the possibility of rewriting the plugin (the native part) using the new ArCore API.

What do you think about?

Thanks.

eduardoGo commented 3 years ago

Hello @giandifra, I think that rewriting the plugin with the new ArCore API is better ... The current version of the plugin has many things with Sceneform, so in the future it will be incompatible and the problem will be bigger since the plugin will have more resources ... (That's just my opinion...).

I am currently trying to implement a function in the Controller so that it is possible for us to take pictures :)

engor commented 3 years ago

Hi. What I'm really need is supporting of .glb / .gltf animations. It's possible by implementing sceneform 1.16.0 (works in native android app). I tried to implement it by myself with no luck yet. It's killer feature for me right now.

giandifra commented 3 years ago

Hello @giandifra, I think that rewriting the plugin with the new ArCore API is better ... The current version of the plugin has many things with Sceneform, so in the future it will be incompatible and the problem will be bigger since the plugin will have more resources ... (That's just my opinion...).

I am currently trying to implement a function in the Controller so that it is possible for us to take pictures :)

Yes, I think that rewriting is the good choice! The new ARCore API has a lot of feature and they are fully supported.

Yesterday, I started to migrate the plugin.

engor commented 3 years ago

Please, provide me link to "new ARCore API".

giandifra commented 3 years ago

Please, provide me link to "new ARCore API".

For "new Arcore API" I mean the api used after that Google has archived Sceneform

engor commented 3 years ago

Ahh, ok. :)

MeIsAlien commented 3 years ago

hi @giandifra , How about creating a new feature that scans any 2d image and converts it to its 3d equivalent, I'm not from disney but disney research had achieved this. checkout their video on how they make a 3d equivalent

maxTeste commented 3 years ago

it is possible to add functionality to rotate objects and change size? in arkit is possible but not here

wiizarrrd commented 3 years ago

@rubenteste I've created a pull request to implement this (translation, rotation and scale)

PeterTF656 commented 3 years ago

Dear Giandifra, thank you for making this plugin! I saw an issue back in 2019 that asked about ios platform compatibility. Are you planning to make this plugin work with ios soon? I know people say ARKIT is the choice for IOS, but for some reasons, like in argumented face, developers would like both the android and ios platform to use the same face mesh...

MeIsAlien commented 3 years ago

Dear Giandifra, thank you for making this plugin! I saw an issue back in 2019 that asked about ios platform compatibility. Are you planning to make this plugin work with ios soon? I know people say ARKIT is the choice for IOS, but for some reasons, like in argumented face, developers would like both the android and ios platform to use the same face mesh...

Hi @PeterTF656 , This may be possible in the future when iOS devices support Google's AR Core, since arcore_flutter_plugin uses this plugin. @giandifra, my suggestion is to put some flutter code inside the plugin to check whether the device is android or iOS, depending on which it would use arcore or arkit. Thereafter, You can create 2 different codebases one for android which uses arcore and is written on kotlin, while the second codebase uses arkit and is written in swift. either of which are downloaded, probably from the cloud or a simple github raw url after the device os has been determined. You can also keep the method names same if that is possible, so flutter developers like me don't have to to create 2 different codebases

Also, thanks for making ar possible in flutter. To be honest, I don't know either swift or kotlin, I can just imagine the difficulty of the suggestion I have given above😬😬😬😬😬.

engor commented 3 years ago

My proposal: make all native kotlin functions to execute in background thread (via coroutines or so). This time we have app freezing and ANR, especially when loading image markers and loading models.

PeterTF656 commented 3 years ago

Dear Giandifra, thank you for making this plugin! I saw an issue back in 2019 that asked about ios platform compatibility. Are you planning to make this plugin work with ios soon? I know people say ARKIT is the choice for IOS, but for some reasons, like in argumented face, developers would like both the android and ios platform to use the same face mesh...

Hi @PeterTF656 , This may be possible in the future when iOS devices support Google's AR Core, since arcore_flutter_plugin uses this plugin. @giandifra, my suggestion is to put some flutter code inside the plugin to check whether the device is android or iOS, depending on which it would use arcore or arkit. Thereafter, You can create 2 different codebases one for android which uses arcore and is written on kotlin, while the second codebase uses arkit and is written in swift. either of which are downloaded, probably from the cloud or a simple github raw url after the device os has been determined. You can also keep the method names same if that is possible, so flutter developers like me don't have to to create 2 different codebases

Also, thanks for making ar possible in flutter. To be honest, I don't know either swift or kotlin, I can just imagine the difficulty of the suggestion I have given above😬😬😬😬😬.

I think google arcore has an ios compatible sdk, you can take a look at this.

eduardoGo commented 3 years ago

Hello @giandifra, I think that rewriting the plugin with the new ArCore API is better ... The current version of the plugin has many things with Sceneform, so in the future it will be incompatible and the problem will be bigger since the plugin will have more resources ... (That's just my opinion...).

I am currently trying to implement a function in the Controller so that it is possible for us to take pictures :)

I finish --> #141 :blush:

giandifra commented 3 years ago

I think that the best solution is rewrite the plugin and add ArCore sdk for iOS side. This solution will be the best from all points of view.

eduardoGo commented 3 years ago

I think that the best solution is rewrite the plugin and add ArCore sdk for iOS side. This solution will be the best from all points of view.

Yes... I found this project https://github.com/CariusLars/ar_flutter_plugin that support iOS and Android.

maxTeste commented 3 years ago

@wiizarrrd can you show me an example how to use the translation, rotation and scale functions that you implemented pls?

wiizarrrd commented 3 years ago

@rubenteste I wrote a small "how to use" for my pull request https://github.com/giandifra/arcore_flutter_plugin/pull/125#issuecomment-867554467

maxTeste commented 3 years ago

thank you so much :)

maxTeste commented 3 years ago

hey @wiizarrrd with the code u post down below is possibly to update for exemple rotation or position of the object after u place the object ?

@rubenteste I wrote a small "how to use" for my pull request #125 (comment)

wiizarrrd commented 3 years ago

@maxTeste yes, that is why I created the pull request

maxTeste commented 3 years ago

@maxTeste yes, that is why I created the pull request

hoo so I have to change the files that you changed ok ok , mb

maxTeste commented 3 years ago

edited: it give me kinda an error: setLocalRotation on AnchorNode while it is anchored is there any way around this problem?

@wiizarrrd did u lately use this functionality. i'm using it now but only can use scale. Rotation and position cant use it

if (objectSelected != null) { //"https://github.com/KhronosGroup/glTF-Sample-Models/raw/master/2.0/Duck/glTF/Duck.gltf" print("aaaaa"); // 0.0, 0.9318101406097412, 0.0, 0.3629460632801056 print(plane.pose.rotation); print("aaaaa"); toucanoNode = ArCoreReferenceNode( name: objectSelected, object3DFileName: objectSelected, position: plane.pose.translation, // [-0.13800017535686493,-1.4293699264526367,-1.8118488788604736] //position: vector.Vector3(plane.pose.translation.x + testeVar,plane.pose.translation.y + testeVar, plane.pose.translation.z + testeVar), //rotation: vector.Vector4(testeVar, 0.9318101406097412, 0.0, 0.3629460632801056)); //rotation: vector.Vector4(testeVar, testeVar, testeVar, testeVar)); rotation: plane.pose.rotation ); //rotate(); arCoreController.addArCoreNodeWithAnchor(toucanoNode); Timer(Duration(seconds: 4), () { print("mmmmmmmm"); toucanoNode.scale.value = vector.Vector3(0.4, 0.4, 0.4); toucanoNode.rotation.value = vector.Vector4(2, 2, 2, 2); toucanoNode.position.value = vector.Vector3(1.2, 1.3, 1.1); //toucanoNode.position.value = vector.Vector3(plane.pose.translation.x - 20, plane.pose.translation.x, plane.pose.translation.x); //toucanoNode.rotation.value = rotation; }); }

scale works fine, but the others 2 don't

toucanoNode.scale.value = vector.Vector3(0.4, 0.4, 0.4); toucanoNode.rotation.value = vector.Vector4(2, 2, 2, 2); toucanoNode.position.value = vector.Vector3(1.2, 1.3, 1.1);

wiizarrrd commented 3 years ago

@maxTeste you used arCoreController.addArCoreNode**WithAnchor**(toucanoNode);. Simply use arCoreController.addArCoreNode(toucanoNode);

maxTeste commented 3 years ago

@wiizarrrd i will try to use it ty :)

MrCsabaToth commented 1 year ago

I wonder what's the plan with the new-sceneform branch (which would upgrade to Thomas Gorisse's maintained SceneForm fork, or even upgrading to SceneView, which is even more actively maintained Kotlin version (#202).

I think any customization to SceneForm should ideally be introduced upstream into Thomas Gorisse's SceneView, since these modifications are real-world needs and induced and this way it would be upstream instead of the burden of this flutter plugin.

I also wonder what will be the consequences of the recently revealed Impeller (Skia successor?) and 3D OpenGL capabilities? I'm excited and I wonder what will this impose to the plugin.

giandifra commented 1 year ago

I wonder what's the plan with the new-sceneform branch (which would upgrade to Thomas Gorisse's maintained SceneForm fork, or even upgrading to SceneView, which is even more actively maintained Kotlin version (#202).

I think any customization to SceneForm should ideally be introduced upstream into Thomas Gorisse's SceneView, since these modifications are real-world needs and induced and this way it would be upstream instead of the burden of this flutter plugin.

I also wonder what will be the consequences of the recently revealed Impeller (Skia successor?) and 3D OpenGL capabilities? I'm excited and I wonder what will this impose to the plugin.

Hi, I will work to migrate the plugin to the new sceneform (sceneview)!