我如何才能只允许从门户进入我的虚拟场景?
How can I only allow entering my virtual scene from a portal?
我有一个应用程序可以呈现增强现实场景和一个您可以走进场景的门户。场景被平面遮挡,但如果您穿过该平面,您就会 "bust" 进入虚拟环境。
我不是在寻找代码,而是在寻找解决此问题的帮助。我想让你进入虚拟场景的唯一方式就是穿过我创建的门口。我首先考虑跟踪相机的位置,并确保在越过阈值以启用渲染之前你非常靠近入口,但似乎如果我这样做,用户将无法看到approaching/entering 虚拟场景前的门口。
首先,看看 Stack Overflow post 如何自己制作门户。
The robust way to prevent users from passing through virtual walls is to have the same configuration of virtual walls like real walls have (where physical wall is – the virtual wall exists too).
您还需要对象检测工具。要将虚拟墙精确定位在真实的物理墙上,只需使用 Core ML framework with pre-trained small-sized mlmodel
along with ARKit framework's classes like ARImageTrackingConfiguration() or ARWorldTrackingConfiguration().
In case you have no opportunity to build the same configuration of virtual walls like real walls were built, you can make a user's iPhone vibrate when a user has collided with a virtual wall. Here's a code:
import AudioToolbox.AudioServices
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate)
希望对您有所帮助。
有几种方法是我能想到的。
当一个人穿过墙壁时,整个屏幕都会变黑,除了一条消息告诉他们需要从墙上后退,也许还有一个箭头告诉他们往哪个方向移动。
让它撞到墙上会移动整个场景。
将两者结合起来,问他们在 运行 撞到墙上时是否愿意转移场景。
我有一个应用程序可以呈现增强现实场景和一个您可以走进场景的门户。场景被平面遮挡,但如果您穿过该平面,您就会 "bust" 进入虚拟环境。
我不是在寻找代码,而是在寻找解决此问题的帮助。我想让你进入虚拟场景的唯一方式就是穿过我创建的门口。我首先考虑跟踪相机的位置,并确保在越过阈值以启用渲染之前你非常靠近入口,但似乎如果我这样做,用户将无法看到approaching/entering 虚拟场景前的门口。
首先,看看
The robust way to prevent users from passing through virtual walls is to have the same configuration of virtual walls like real walls have (where physical wall is – the virtual wall exists too).
您还需要对象检测工具。要将虚拟墙精确定位在真实的物理墙上,只需使用 Core ML framework with pre-trained small-sized mlmodel
along with ARKit framework's classes like ARImageTrackingConfiguration() or ARWorldTrackingConfiguration().
In case you have no opportunity to build the same configuration of virtual walls like real walls were built, you can make a user's iPhone vibrate when a user has collided with a virtual wall. Here's a code:
import AudioToolbox.AudioServices
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate)
希望对您有所帮助。
有几种方法是我能想到的。
当一个人穿过墙壁时,整个屏幕都会变黑,除了一条消息告诉他们需要从墙上后退,也许还有一个箭头告诉他们往哪个方向移动。
让它撞到墙上会移动整个场景。
将两者结合起来,问他们在 运行 撞到墙上时是否愿意转移场景。