giandifra / arcore_flutter_plugin

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

Support for .gltf / .obj objects #122

Open leoduckcd opened 3 years ago

leoduckcd commented 3 years ago

Since the Sceneform plugin is no longer supported in Android Studio and you therefore cannot convert a 3D-object into a .sbf file, is there any possibility that you could use a .gltf or .obj object instead? There is a Maintained Sceneform SDK for Android (https://github.com/ThomasGorisse/sceneform-android-sdk) which supports the glTF format, how can you implement it in your flutter project with the arcore_flutter_plugin?

matwright commented 3 years ago

Remote gltf works fine.

use ArCoreReferenceNode and the objectUrl parameter to your gltf file.

leoduckcd commented 3 years ago

How could I store the .gltf file locally?

matwright commented 3 years ago

maybe try a local http server like https://pub.dev/packages/local_assets_server let me know if you get it working.

wiizarrrd commented 3 years ago

I also use a local server. Can't you save the .gltf file as an asset and use this path?

wiizarrrd commented 3 years ago

Here is my solution for local files: Frame.glb is stored in the Flutter App und assets/Frame.glb and it is also declared in pubspec.yaml

2.nd : String objectName= 'Frame.glb'; String pathToObject; await for (var entity in Directory.systemTemp.list(recursive: true, followLinks: false)) { if (entity.path.endsWith(objectName)){ print(entity.path); pathToObject=entity.path; } }

infoNode = ArCoreReferenceNode( name: "Frame", objectUrl: pathToObject, );

KennyChan94P commented 2 years ago

@wiizarrrd it seems like you have the solution. can you please send a screenshot of your chunk of code here? i tried with your solution above but i cant make it work.

wiizarrrd commented 2 years ago

@KennyChan94P this is my code. However it is a very bad workaround as it works via searching in the whole system folder for the object.