"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Controlling camera focus in Unity plugin

How can I control the camera focus in the Unity3d plugin? Thanks EDIT: I figured out how to do this: In Unity3d (project window), scroll to the folder named "Scripts". This is the scripts folder in the root of your project, and not the one in the Qualcomm Augmented Reality folder. There will be a file named "CameraDeviceMenu". Drag it onto "ARCamera" in the Hierarchy window on the left. Now if you run the application and click on the background, a menu will popup which allows you to focus the camera, use the flash as a flashlight, or change the focus modes.

ThomasOosting

Fri, 05/20/2011 - 12:03

The menu is great, but if i want to use the functionality of the screen (interaction with the content) won't i run into the menu the entire time ? Isn't there a way to modify the script so the autofocus is always on ?

Hello :) How can I use it in javascript? I need to turn on AutoFocus and have acces to Flash in c# it's: [CODE]CameraDevice.Instance.SetFlashTorchMode(true)[/CODE] in javascript I wanna use code like this: [CODE] function OnGUI() { if (GUI.Button(Rect(Menu.x,Menu.y,Menu.z,Menu.w),"Flash")

Mixing Javascript and C# is a bit tricky. If the Javascript depends on C# classes, then you need to ensure that the C# classes are compiled first. You can do this by putting them in a folder that is compiled in an earlier pass, e.g. the Plugins folder.

suppenhuhn

Fri, 03/16/2012 - 13:10

[QUOTE=ksiva]The menu is just meant to provide sample code, I suggest turning it off when you start writing your own application. It's the CameraDeviceMenu script attached to the ARCamera.

DavidBeard

Sat, 03/17/2012 - 17:15

If your installation doesn't have the CameraDeviceMenu.cs script, you can use the one I've attached. Be sure to change the file extension so that the file is named CameraDeviceMenu.cs

I suggest downloading the final 1.5 release (it sounds like you still have the beta). The CameraDeviceMenu.cs script should be in the Scripts folder of any of the sample applications. Note the script David attached depends on 1.5 final. - Kim