Log in or register to post comments

How to set focus mode?

July 29, 2014 - 11:08am #5

There is documenation on setting focus modes here

However, this code cannot be used as it is published.  When trying to build this code, there is an invalid token in the "if". 

I tried some small changes to at least compile the code.  But the code still does not seem to run. 

I could have sworn there were some other examples or some code in an example I could use, but I can't seem to find that anywhere now. 

Can someone tell me how to set the focus mode?

How to set focus mode?

July 29, 2014 - 11:44pm #4

I just tried the code in the article you refer to, 

I simply copy-pasted the C# snippet into MonoDevelop and it works just fine (compiles and runs).

 

I'm copy-pasting it again over here:

bool focusModeSet = CameraDevice.Instance.SetFocusMode(  
    CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
 
if (!focusModeSet) {
    Debug.Log("Failed to set focus mode (unsupported mode).");
}

 

How to set focus mode?

September 6, 2014 - 6:35am #3

where should i place the code

How to set focus mode?

September 15, 2014 - 9:50pm #2

I am a beginner in unity and vuforia

I know the script to set auto facus in c# is 

but i dont know where to put this code in?

I just want the autofacus mode will be actived in program start .

bool focusModeSet = CameraDevice.Instance.SetFocusMode(      CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);

if (!focusModeSet)

{

    Debug.Log("Failed to set focus mode (unsupported mode).");
}

 

 
 

How to set focus mode?

September 19, 2014 - 8:40am #1

Hi youjunjer

I try that and it works like

public class WebCamBehaviour : WebCamAbstractBehaviour
{
	void Start(){
		bool focusModeSet = CameraDevice.Instance.SetFocusMode(      CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
		if (!focusModeSet)
		{
			Debug.Log("Failed to set focus mode (unsupported mode).");
		}
	}
}

in WebCamBehaviour.cs of ARCamera

Log in or register to post comments