SceneKit LIDAR iOS:以不同的颜色/纹理在背景中显示相机视图的未扫描区域
我正在构建一个类似于Polycam,3D扫描仪应用程序,Scaniverse等的应用程序。我可视化扫描区域的网格并将其导出到不同的格式。我想向用户展示哪些区域被扫描,什么没有。为此,我需要区分它们。
我的想法是构建像Polycam这样的东西。 < 我尝试更改场景的背景内容属性的未频率区域的Polycam蓝色背景
,但它导致整个相机视图被颜色替换。
arSceneView.scene.background.contents = UIColor.black
我正在使用ARSCNVIEW并设置平面检测,如下所示:
private func setupPlaneDetection() {
let configuration = ARWorldTrackingConfiguration()
configuration.planeDetection = [.horizontal, .vertical]
configuration.sceneReconstruction = .meshWithClassification
configuration.frameSemantics = .smoothedSceneDepth
arSceneView.session.run(configuration)
arSceneView.session.delegate = self
// arSceneView.scene.background.contents = UIColor.black
arSceneView.delegate = self
UIApplication.shared.isIdleTimerDisabled = true
arSceneView.showsStatistics = true
}
预先感谢您提供的任何帮助!
I'm building an app similar to Polycam, 3D Scanner App, Scaniverse, etc. I visualize a mesh for scanned regions and export it into different formats. I would like to show the user what regions are scanned, and what not. To do so, I need to differentiate between them.
My idea is to build something like Polycam does..
< Polycam blue background for unscanned regions >
I tried changing the background content property of the scene, but it causes the whole camera view to be replaced by the color.
arSceneView.scene.background.contents = UIColor.black
I'm using ARSCNView and setting up plane detection as follows:
private func setupPlaneDetection() {
let configuration = ARWorldTrackingConfiguration()
configuration.planeDetection = [.horizontal, .vertical]
configuration.sceneReconstruction = .meshWithClassification
configuration.frameSemantics = .smoothedSceneDepth
arSceneView.session.run(configuration)
arSceneView.session.delegate = self
// arSceneView.scene.background.contents = UIColor.black
arSceneView.delegate = self
UIApplication.shared.isIdleTimerDisabled = true
arSceneView.showsStatistics = true
}
Thanks in advance for any help you can provide!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我之前已经通过在场景中添加一个球体来完成此操作,该球体具有两侧材质(稍微透明)并且半径足够大,以便相机和扫描的表面始终位于其内部。下面是如何执行此操作的示例:
请注意,我使用的是黑色 - 您显然可以将其更改为您需要的任何颜色,但保持 alpha 通道稍微透明。并调整球体的半径,使其适合您的场景。
I’ve done this before by adding a sphere to the scene with a two-sided material (slightly transparent) and with a radius large enough that the camera and the scanned surface will always be inside of it. Here’s an example of how to do that:
Note that I’m using a black color - you can obviously change this to whatever you need, but keep the alpha channel slightly transparent. And tweak the radius of the sphere so it works for your scene.