如何在不使用相机的情况下使用带有一些自定义背景视图的 ARKit iOS 11 放置 3D 模型? [英] How to place 3D model using ARKit iOS 11 with some custom background view without using camera?
问题描述
我正在开发一个增强现实 iOS 应用程序,我使用的是 iOS 11 测试版的 ARKIT.我正在使用 ARSCNView(SceneKit) 来呈现我的 .scn 对象.我已经按照苹果给出的示例创建了一个 ARSession(https://developer.apple.com/sample-code/wwdc/2017/PlacingObjects.zip).是否可以使用自定义背景而不是相机放置 3D 模型?
I am working on an Augmented Reality iOS app for which i am using ARKIT of iOS 11 beta. I am using ARSCNView(SceneKit) to render my .scn object. I have followed the sample given by apple in order to create an ARSession(https://developer.apple.com/sample-code/wwdc/2017/PlacingObjects.zip). Is it possible to place the 3D model with custom background instead of camera?
喜欢用户可以选择背景颜色或可以提供自定义2D照片作为背景?
Like user can select the background color or can provide custom 2D photos as background?
推荐答案
您的视图具有 scene
属性,您可以在其中将 background
设置为颜色或图像:
Your view has a scene
property where you can set the background
to a color or an image:
view.scene.background.contents = UIColor.red
let myImage: UIImage = ...
view.scene.background.contents = myImage
这篇关于如何在不使用相机的情况下使用带有一些自定义背景视图的 ARKit iOS 11 放置 3D 模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!