By hardik_vh
on Wed, 06/20/2012 - 17:07
Hi,
I m trying to overlay image on frame marker but the image does not overlay properly and it is also not zoom-in or zoom-out when camera comes closer to marker or away from marker.
I used below post to get the coordinates
[url]https://ar.qualcomm.at/arforums/showpost.php?p=3538&postcount=8[/url]
using this post i get x,y,width and height as below:
CGFloat x = ShaderUtils::minVal(s0.x,s1.x,s2.x,s3.x);
CGFloat y = ShaderUtils::minVal(s0.y,s1.y,s2.y,s3.y);
CGFloat width = ShaderUtils::maxVal(s0.x,s1.x,s2.x,s3.x) - x;
CGFloat height = ShaderUtils::maxVal(s0.y,s1.y,s2.y,s3.y) - y;
After this, I set this coordinates to imageview frame as below:
CGRect sBounds = CGRectMake(x, y, width, height);
myImageView.frame = sBounds;
But the view does not fit into marker's view and also it does not update x and y based on current coordinates once i move camera away from marker.
Please someone can point me what i m doing wrong?
Thanks,
Hardik
Re: Get coordinates to overlay image
Re: Get coordinates to overlay image
Re: Get coordinates to overlay image
Re: Get coordinates to overlay image
Re: Get coordinates to overlay image
Re: Get coordinates to overlay image
Re: Get coordinates to overlay image
Re: Get coordinates to overlay image
Re: Get coordinates to overlay image
Get coordinates to overlay image
Hi,
Can we overlay a png or jpg image when the target image is detected in ios ?
Get coordinates to overlay image
I do not see any reason why not.
Maybe the easiest way would be to overlay a plane containing the texture, as this way you will also get a 3d appearance to it.
Depends what you want.
Get coordinates to overlay image
Thanks for the reply. Actually i am able to overlay a 3d or 2d shape using open gl on the target image. To overlay any png image over image target do we need to use opengl ?
Could please help me out by providing any code snippet...
Get coordinates to overlay image
Like I said, it's probably worth searching the forums, as it is amazing what you can find...
Although this link is for Android, you may be able to apply it in iOS:
https://developer.vuforia.com/resources/dev-guide/textured-plane-target
N
Get coordinates to overlay image
Thanks a lot for your reply. Now i am able to overlay any png image over the detected target.
I am able to change the x and y cooridinates of the texture which is being overlayed .
Wanted to know whether can i change the size of the overlayed texture?
Get coordinates to overlay image
Have you tried changing the scale of the coordinates from 0.5 to something bigger?
N
Get coordinates to overlay image
Hey thanks a lot.. By changing the scale of coordinates i am able to change the size of overlayed texture .
Get coordinates to overlay image
Glad I could help :)
N
Can anyone guide me how to
Can anyone guide me how to get coordinates to overlay image for the latest library? I am trying to get x, y, width and height to place image over the image target.