xcode ARKit 支持哪些 3D 模型格式?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/48190891/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:31:04  来源:igfitidea点击:

What 3D model formats are supported by ARKit?

swiftxcodescenekitaugmented-realityarkit

提问by user3371261

What 3D model formats are supported by ARKit? Does someone know all supported formats for using in ARKit, and which format Xcode can export to use in app?

ARKit 支持哪些 3D 模型格式?有人知道在 ARKit 中使用的所有支持格式,以及 Xcode 可以导出哪些格式以在应用程序中使用吗?

回答by leandrodemarco

DAE and OBJ/MTL are automaticallysupported, in the sense that you can just drop the files in the .scnassets folder and it will handle them for you. Personally, I had fewer issues with OBJ/MTL but I'm not well versed in 3D.

DAE 和 OBJ/MTL 是自动支持的,从某种意义上说,您只需将文件放在 .scnassets 文件夹中,它就会为您处理它们。就我个人而言,我在 OBJ/MTL 方面遇到的问题较少,但我不太精通 3D。

The documentation for Model I/Ostates that you can import 3D assets from the following files

Model I/O的文档说明您可以从以下文件导入 3D 资产

The set of supported formats includes Alembic (.abc), Wavefront Object (.obj), Polygon (.ply), and Standard Tessellation Language (.stl). Additional formats may be supported as well.

支持的格式集包括 Alembic (.abc)、Wavefront Object (.obj)、Polygon (.ply) 和 Standard Tessellation Language (.stl)。也可以支持其他格式。

I've not worked with this framework though, so can't tell you how well does it work with ARKit.

不过我没有使用过这个框架,所以不能告诉你它与 ARKit 的配合情况如何。

And you may want to have a look at AssimpKitwhich allows to export several formats to .scn SceneKit scenes

你可能想看看AssimpKit它允许将多种格式导出到 .scn SceneKit 场景

回答by Andy

ARKit 2.0framework, as well as SceneKitframework, support several popular 3D file formats at the moment:

ARKit 2.0框架,以及SceneKit框架,目前支持几种流行的 3D 文件格式:

  • Collada's Digital Asset Exchange .dae

  • Pixar's Zipped Universal Scene Description .usdz

  • Pixar's ASCII Universal Scene Description .usda

  • Pixar's Binary Universal Scene Description .usd, .usdc

  • Wavefront Object .objalong with material .mtl

  • Alembic interchange file format .abc

  • Polygon File Format .ply

  • Stereolithography File Format .stl

  • SceneKit Scene .scn

  • Collada 的数字资产交易所 .dae

  • 皮克斯的压缩通用场景描述 .usdz

  • 皮克斯的 ASCII 通用场景描述 .usda

  • 皮克斯的二进制通用场景描述.usd.usdc

  • 波前对象.obj和材料.mtl

  • Alembic 交换文件格式 .abc

  • 多边形文件格式 .ply

  • 立体光刻文件格式 .stl

  • SceneKit 场景 .scn

The best way to use those formats is to initialize SCNScenefrom MDLAssset like this:

使用这些格式的最佳方法是SCNScene像这样从 MDLAssset初始化:

import SceneKit.ModelIO

guard let url = Bundle.main.url(forResource: file, withExtension: "usdz") else { 
    fatalError() 
}
let mdlAsset = MDLAsset(url: url)
let scene = SCNScene(mdlAsset: mdlAsset)

Hope this helps.

希望这可以帮助。

回答by Ian Terrell

The full set of file types documented as supported by the Model I/O framework can be found here:

可以在此处找到模型 I/O 框架支持的完整文件类型集:

https://developer.apple.com/documentation/modelio/mdlasset/1391813-canimportfileextension

https://developer.apple.com/documentation/modelio/mdlasset/1391813-canimportfileextension

The set of supported extensions and formats includes:

  • .abc Alembic
  • .usd, .usda, .usdc Universal Scene Description
  • .usdz Universal Scene Description (Mobile)
  • .ply Polygon
  • .obj Wavefront Object
  • .stl Standard Tessellation Language

Additional formats may be supported as well.

支持的扩展和格式集包括:

  • .abc 蒸馏酒
  • .usd、.usda、.usdc 通用场景描述
  • .usdz 通用场景描述(移动)
  • .ply 多边形
  • .obj 波前对象
  • .stl 标准曲面细分语言

也可以支持其他格式。

It looks like Apple's new preferred file type for ARKit on iOS (as of iOS 12) is their own usdz:

看起来 Apple 在 iOS 上(从 iOS 12 开始)为 ARKit 提供的新首选文件类型是他们自己的 usdz:

https://developer.apple.com/augmented-reality/quick-look/

https://developer.apple.com/augmented-reality/quick-look/