Log in or register to post comments

Vuforia image detection for 2D game

October 1, 2015 - 12:39pm #1

I'm trying to develop a 2D game where when the player holds up objects to the device webcam, the sprites animate. It seems that Vuforia's object detection is the best for setting this up, but I don't need to take advantage of the AR aspects of Vuforia. Just the object detection, which will then render sprite actions on a 2D game background, with no webcam feedback visible.

I've tried setting up a 2D camera on top of the Vuforia 3D camera, but this doesn't work. How would I go about doing this? Can I somehow get the Vuforia camera to sit 'behind' a 2D game?

Vuforia image detection for 2D game

October 8, 2015 - 8:37pm #2

You can disable the background camera feed like this:

GameObject.FindObjectOfType<VideoTextureRenderer>().enabled = false;

You can set the video background to your own texture using:

VuforiaRenderer.Instance.SetVideoBackgroundTexture(texture2d, id);

You can also layer cameras in Unity by changing the Depth value:

http://docs.unity3d.com/Manual/class-Camera.html

 

Log in or register to post comments