本文介绍了如何更改Vuforia AR相机对焦模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Unity中使用 Vuforia 6.2 AR SDK .但是,当我在Android手机上测试该应用程序时,相机看起来像是模糊.我在Vuforia的开发人员网站上进行了搜索,找到了一些相机对焦模式,但由于该指南适用于较早的Vuforia SDK,所以无法实现,我找不到他们在其网站中提到的脚本.这是他们的代码示例,但无法正常工作.我创建了其他脚本,并在Start()函数上运行了此行,但仍无法正常工作.
I am using Vuforia 6.2 AR SDK for in Unity. But while I test the application in Android phone the camera seems like blurry. I searched in Vuforia's developer website and found some camera focus mode but I can't implement because that guideline was for older Vuforia SDK, I can't find the script they mentioned in their website. Here is their code sample but it's not working. I created different script and run this line on Start() function, but still not working.
CameraDevice.Instance.SetFocusMode(
CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
推荐答案
尝试一下
void Start ()
{
VuforiaBehaviour.Instance.RegisterVuforiaStartedCallback(OnVuforiaStarted);
VuforiaBehaviour.Instance.RegisterOnPauseCallback(OnPaused);
}
private void OnVuforiaStarted()
{
CameraDevice.Instance.SetFocusMode(
CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
}
private void OnPaused(bool paused)
{
if (!paused) // resumed
{
// Set again autofocus mode when app is resumed
CameraDevice.Instance.SetFocusMode(
CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
}
}
这篇关于如何更改Vuforia AR相机对焦模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!