问题描述
在我的项目中,我正在使用ARKit投影3d文件.我可以投影.dae
和.obj
格式模型.
In my project I am projecting 3d files using ARKit. I am able to project .dae
and .obj
format models.
反正我可以加载.fbx
文件吗?
Is there anyway I could load .fbx
files?
推荐答案
ARKit不在场景中加载3D模型.这是SceneKit或RealityKit的工作.但是,两个框架都不直接支持.fbx
文件格式.您可以通过 ModelIO 来实现对.fbx
文件格式的读取,但这是一项不平凡的任务
ARKit isn't loading 3D models in a scene. It's a job for SceneKit or RealityKit. However both frameworks don't directly support .fbx
file format. You could implement a reading of .fbx
file format via ModelIO but it's a non-trivial task.
准备模型以在ARKit,SceneKit和RealityKit中工作的最佳方法是将其转换为usdzconvert命令添加noreferrer>.usdz 文件.
The best way to prepare your model for working in ARKit, SceneKit and RealityKit is to convert it into .usdz file via new usdzconvert
command found in Xcode 11 and Xcode 12.
要将.fbx
文件转换为.usdz
,只需在终端中输入以下行:
For converting .fbx
file into .usdz
just type the following line in Terminal:
usdzconvert file.fbx -diffuseColor diff.jpg -normal norm.jpg -occlusion ao.jpg
要使用此转换工具,请从开发人员资源中下载 usdz工具并且不要忘记设置全局变量.
To use this conversion tool, download usdz Tools from developer resource and don't forget to setup a global variables.
有关其他信息,请阅读此发布.
For additional info please read THIS post.
这篇关于有什么方法可以使用ARKit加载FBX文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!