Log in or register to post comments

How to move device camera or stuck objects at specific location in Unity3d

January 8, 2013 - 11:09pm #7

I am making an app in Unity3d. Its about geocaching, when user reach at specific location and keep device at specific direction let say on some building then app show a 2d or 3d objects, and that object should be stuck with building either user move device camera. What i did so far I added a plan and add texture on it and when user reach a particular location I am showing that texture but this texture is attach to the Camera and its moving with device movements. I use gyro but thats not work which I required. Why I post at here because I am following ImageTarget Sample for Unity3d and also you guys are acheiving same thing which I required when App get marker it show some texture on it and that texture stuck to the marker, and I need same thing but this should be relevant to any location not to marker. Can anyone help me on that. This will be great for me. Thanks in advance.

Hi, what we do with markers

January 8, 2013 - 11:19pm #6

Hi, what we do with markers (or image targets) in Vuforia is that the target is detected by Vuforia, then its position and orientation ("pose")  are computed with respect to the camera; the position+orientation of the target is recomputed at every frame and this is very accurate due to the use of the advanced computer vision algorithms used by Vuforia; that's why the texture stays concistently attached to the target even if we move the camera.

In your case, things are different, as the pose of the target is computed from GPS and orientation sensors of the device; these are both not very accurate in general, so probably you will not be able to achieve the same results as for image targets in Vuforia.

One good way of tackling this would be to integrate your approach with some computer vision techniques, but that's of course fairly complex, beyond the scope of what I can suggest here.


Hi Aleem "when user reach a

January 9, 2013 - 3:21am #5

Hi Aleem

"when user reach a particular location I am showing that texture but this texture is attach to the Camera and its moving with device movements"

Is your augmentaion a child of the Image Target?

If not that might explain why it moves with the camera.


"when user reach a particular

January 9, 2013 - 4:02am #4

"when user reach a particular location I am showing that texture but this texture is attach to the Camera and its moving with device movements", This is what I did so far. But I required when user reached at particular location then App should show Texture and that texture Shouldn't attach with camera this should attack some Plane or any object. Like you guys are doing in Augmented Reality "showing some texture on marker and that texture sticked with marker whether it is 2d or 3d object", so thats same think I want to do in my App but that shouldn't relative to marker, i think that should be some GPS location. When user keep device on some building, it show some texture that should be sticked with building.

Hi aleem_razzaq, indeed, the

January 9, 2013 - 4:20am #3

Hi aleem_razzaq, indeed, the marker works in Vuforia because they allow correlating the marker / target reference frame (which becomes your world reference frame) with the camera reference frame; 

since you just want to attach your augmentation to a building or other real world objects without using markers, you indeed need to use GPS and/or other geolocalization sensors, as I explained also in my previous post.

This is going to be usually very inaccurate; Vuforia can only help if you plan to attach some Image/marker to the real world objects, otherwise you need to implement your own mechanism.


Thanks Nalin,  As I mentioned

January 9, 2013 - 4:59am #2

Thanks Nalin, 

As I mentioned that I am able to get Location from GPS and also direction from compass. But where I am stuck is to show a object at specific point and that should be stick at some place. It is not like to detect building and show some texture. I just want to know that how you guys did that to stick texture at specific point, I just need that approach rest of whole project mine.

OK, I see; in our samples we

January 9, 2013 - 5:18am #1

OK, I see; in our samples we just put (as Nalin also mentioned) the augmentation as a Child of the ImageTarget game object (see the scenegraph structure);

the ImageTarget object then contains a Transformation (position + orientation + scale) which reflects the orientation of the real-world object as seen from the camera (and such position/orientation is computed internally by some computer vision algorightms);

so, whenever the camera moves, then position/orientation is updated, then the ImageTarget game object transformation is updated accordingly; then as a consequence the Child object (the augmentation) will appear as attached to the image target (and will not follow the camera).


Log in or register to post comments