我刚接触flutter,目前正在开发一个基于AR的应用程序。我想在运行时创建可渲染的3d Sceneform资源。我知道如何在build.gradle文件中定义Sceneform资源,但这不是动态的。
在编译中创建3d场景形式资源的方法(应用程序级别build.gradle):
sceneform.asset('sampledata/earth.obj',
'default',
'sampledata/earth.sfa',
'src/main/assets/earth_model')但是我想在运行时创建一个场景形式的资源。我使用的是arcore_flutter_plugin和谷歌的AR内核和sceneform。我找不到任何辅助/示例在运行时从flutter中的firebase存储中渲染3d场景形式资源。所有可用的文档都是针对java和kotlin的。在运行时渲染场景形式资源的目的是从firebase storage加载.sfb文件,并在应用程序中渲染它,以保持应用程序的轻量级。
发布于 2021-05-15 06:57:48
如果您深入研究文档文档,您会发现带有参数objectUrl https://pub.dev/documentation/arcore_flutter_plugin/latest/arcore_flutter_plugin/ArCoreReferenceNode/objectUrl.html的ArCoreReferenceNode类。
我将从example app code中获取
final toucanNode = ArCoreReferenceNode(
name: "Toucano",
objectUrl:
"https://github.com/KhronosGroup/glTF-Sample-Models/raw/master/2.0/Duck/glTF/Duck.gltf",
position: plane.pose.translation,
rotation: plane.pose.rotation,
);
arCoreController.addArCoreNodeWithAnchor(toucanNode);https://stackoverflow.com/questions/67491445
复制相似问题