如何在不使用相机的情况下使用带有一些自定义背景视图的ARKit iOS 11放置3D模型? [英] How to place 3D model using ARKit iOS 11 with some custom background view without using camera?

查看:245
本文介绍了如何在不使用相机的情况下使用带有一些自定义背景视图的ARKit iOS 11放置3D模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个增强现实iOS应用程序,为此我正在使用iOS 11 beta的ARKIT.我正在使用ARSCNView(SceneKit)呈现我的.scn对象.我已按照apple给出的示例创建了一个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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆