Log in or register to post comments

colAR mix app + tracked area as main texture

July 9, 2014 - 1:55am #1

Hey guys,

 

I have recently seen the colAR mix app and I really liked the idea of drawing something and useing it as a main texture of an object.

I would like to do that in unity but I can't figure out how.

I guess at first I need something like a screenshot from my AR camera. After that I have to wrap it or transform it until it has the same size and form as the marker?!

I read someting about camera patch, but only for native sdk. Maybe someone has done it for unity and can help me with that?

 

Thanks!

colAR mix app + tracked area as main texture

November 29, 2015 - 8:15pm #8

hi,I'm doing  the 3 steps you mentioned to get the ImageTarget in CameraImage. But after step 2, by using Camera.worldToScreenPoint() function, the corners'  coordinates seem not so accurate,  and I use these screen(or viewport) coordinates of corners to get the picture from CameraImage,then it's bigger than the actual ImageTarget(that means the actual ImageTarget falls in the picture that I get, just a portion of my picture).   and the portion scale is affected by the distance between the camera and the trackable ImageTarget.    I don't kwow why ?  why ithe screen coordinates are not accurate,   and why the Imagetarget portion of picture that I get is varying by the distance?

can you help me?

 

colAR mix app + tracked area as main texture

June 22, 2015 - 4:47pm #7

colAR mix app + tracked area as main texture

June 18, 2015 - 8:49am #6

has anyone had any success with this 

colAR mix app + tracked area as main texture

September 10, 2014 - 12:33am #5

Hey, 

Have you figured out how to do this? I am also working on the same, but have no success till date.

colAR mix app + tracked area as main texture

September 4, 2014 - 12:56am #4

Hi,

going back to the original question, a couple of ways for extracting a screenshot and/or the Vuforia camera image in Unity are already documented in the Knowledge Base page of the developer guide:

https://developer.vuforia.com/resources/dev-guide/unity-camera-image-access

https://developer.vuforia.com/resources/dev-guide/unity-screenshots

Concerning how to extract a specific sub-portion of the camera image (for instance the part that correspond to the image target rectangle), this can be done at application level by:

  1. computing the position (in world coordinates) of the 4 corners of the image target (you can do this using the Transform component of each Trackable game object)
  2. projecting each of the 4 corners above to screen (pixel) coordinates (this can be done using the Unity Camera API, i.e. Camera.WorldToScreenPoint:  http://docs.unity3d.com/ScriptReference/Camera.WorldToScreenPoint.html)
  3. use the pixel coordinates to look up into the screenshot texture and extract the relevant portion of pixels out of it and build up your own texture that contains those pixels

Please note that the technique highlithed in points 1,2,3 above relates to general Unity programming and general 2D/3D graphics programming, so, you may also want to search some Forums that discuss advanced 3D programming techniques and Unity programming techniques, as there might also be other ways of achieving this.

 

Concerning this suggestion:

The better way is if Vuforia created some sort of API/Library to grab the Texture of the Image Target on Runtime and allow us to use it.

The best is probably to post this suggestion in the Forum Wish List, which is periodically reviewed in order to take into consideration the most popular requests from developers:

https://developer.vuforia.com/forum/general-discussion/wish-list

 

I hope this helps.

 

 

colAR mix app + tracked area as main texture

August 26, 2014 - 7:52pm #3

The better way is if Vuforia created some sort of API/Library to grab the Texture of the Image Target on Runtime and allow us to use it.

But that is really a big IF.

 

I came across this article that mentions about UCS (Unified Coordinate System):

http://forum.unity3d.com/threads/unified-coordinate-system-for-string-and-qcar.108256/

 

It is able to somehow grab the texture of the image target texture on runtime. Although I've explored it for a few days and I couldnt really replicate it in a simpler way.

 

I hope somebody could give us a clue or gave us a sample on how do we do it.

colAR mix app + tracked area as main texture

July 30, 2014 - 12:12am #2

I'm also struggling for months to find a way to use camera patch in unity and have seen other guys also struggling with it.

It will be great if someone can help us with this.

Log in or register to post comments