简体   繁体   English

如何将一个dae导入到SceneKit for ARKit

[英]How to import a dae to SceneKit for ARKit

If I run Xcode's ARKit project template, I can move around the default ship as expected. 如果我运行Xcode的ARKit项目模板,我可以按预期移动默认的船只。

I have tried importing some dae models that I have exported from Blender, switching the ship to the new item but keeping the code the same. 我已经尝试导入一些我从Blender导出的dae模型,将船只切换到新项目,但保持代码相同。 They always show in view but position in front the camera. 它们总是显示在视野中,但位于相机前方。 If I try to move around the model it sticks infront of the camera and doesn't stay in the same virtual space. 如果我试图在模型周围移动它会粘在相机的前面并且不会停留在同一个虚拟空间中。

I have also tried importing a dae from another tutorial and that works as expected. 我也尝试从另一个教程导入一个dae,并按预期工作。

Does anything need setting when exporting a 3d model as a Collada dae file to make sure it will anchor to a position in ARKit? 将3d模型导出为Collada dae文件时是否需要设置以确保它将锚定到ARKit中的某个位置?

When importing 3D-models for ARKit make sure to check: 导入ARKit的3D模型时,请务必检查:

  • the scale of your file. 您的文件的规模。 One unit equals 1 meter 一个单位等于1米
  • The model should be centered in the coordinate origin to make it easy to position the model 模型应以坐标原点为中心,以便于定位模型

Try to import the file in the SceneKit editor in Xcode and check if it gets imported correctly. 尝试在Xcode中的SceneKit编辑器中导入文件,并检查它是否正确导入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM