Log in or register to post comments

Camera background to GUITexture?

March 23, 2012 - 2:25pm #1

How hard would it be to have the camera's image paint into a GUITexture?

Re: Camera background to GUITexture?

March 23, 2012 - 3:49pm #3

I think that's how, though I have seen Kinect code that uses a GL library to slam it in. I need the background image to be responsive just looking around, but when user hits a key, it needs to grab the pixels and do some stuff. Basically take a picture. I know this might be better not using AR at all, but this is just the first step, other AR features to come later.

I was hoping I could just set the native texture id on a GUITexture to the one created, and set that into QCAR to render into it. That doesn't seem to work, let along getting pixels into a buffer when user hits the key.

Re: Camera background to GUITexture?

March 23, 2012 - 3:30pm #2

I think that you're going to need to map the byte array from CameraDevice.Instance.GetCameraImage(mPixelFormat).Pixels to Unity Color structs and set these to a Texture2D which you can then assign to the GUITexture.

This might be a good question for Unity Answers, or their Forum. There is probably an established way to deal with pixel data in byte form.

Log in or register to post comments