Hi,
I've followed the following posts : image access, camera target patch and camera pstch for unity3D
Hi,
I've followed the following posts : image access, camera target patch and camera pstch for unity3D
That's because the target transform component has a localScale set to the Target dimensions; so, in the local reference frame of the target, the target width is actually spanning between -0.5 (left border) and +0.5 (right border).
Same for the height, except that you need to divide by the aspect ratio of the target, because the localScale is uniformly set, but the image target is a rectangle (where height = width / aspect ratio).
Hope it makes sense.
Hi,
I'm following the steps from How can I get target screen coordinates, but I can't undestand why using:
// We define a point in the target local reference// we take the bottom-left corner of the target,// just as an example// Note: the target reference plane in Unity is X-Z,// while Y is the normal direction to the target planeVector3 pointOnTarget = new Vector3(-0.5f, 0, -0.5f/targetAspect);
is taking the bottom-left corner of the image target.
Is it possible (in C# and with unity) to get juste the image target area (in the screen view) and put it into a texture ?
Yes, if you manage to cut the part of the camera image (based on the 4 corners in screen cordinates, as I was mentioning),
then you should be able to extract the image within the trapeziod boundaries defined by the 4 corners in screen space.
Then once you have that image, you can build a texture in C# and Unity, for instance using the Texture2D.LoadImage() function:
http://docs.unity3d.com/Documentation/ScriptReference/Texture2D.LoadImage.html
One thing you could do is to compute the screen coordinates (in pixels) of each of the 4 corners of the image target that is in your camera fieled of view.
I already have compute the screen coordinates of each of the 4 corners in my camera view.
Then, once you have the screen coordinates of those 4 points, you could implement some sort of deformation filter that turns the "trapezoid" shape into a rectangle, by extracting the relevant pixels.
It's this step that I try to do.
However, this kind of filtering techniques is beyond the scope of Vuforia and this Forum.
I post this post in this forum because some people has succeeded to do this using the vuforia sdk.
I've tried to understand the elecman's solution but it's too confused for me.
Is it possible (in C# and with unity) to get juste the image target area (in the screen view) and put it into a texture ?
The goal is to apply it then to a 3D model using UV mapping.
Hi, one thing you could do is to compute the screen coordinates (in pixels) of each of the 4 corners of the image target that is in your camera fieled of view;
this article explains this:
https://developer.vuforia.com/forum/faq/unity-how-can-i-get-target-screen-coordinates
Then, once you have the screen coordinates of those 4 points, you could implement some sort of deformation filter that turns the "trapezoid" shape into a rectangle, by extracting the relevant pixels.
However, this kind of filtering techniques is beyond the scope of Vuforia and this Forum.
hey
I am also tring to do the same. but my aproach was of elecman, but i didnt even succed to get the target image from the entire scene. It will be of great help if you can tell me what is your approach on this and how to wrap the texture on the 3d model. thanks in advance.