How to Reverse the camera motion On Augmentation ?

April 14, 2015 - 10:31pm #1

Hi All,

Unity3d 4.6.3 + Vuforia 4-0-103 we are using.

We have a project which is something different than general AR project.

In General, On Augmentation if we come closer to Tracker, Augmented object looks bigger. As well as if we go far from the tracker Augmented object looks smaller.

But in my project i need to implement like this : If i go far from the Tracker Augmented object should apper bigger and if i come closer to tracker Augmented object should appear small.

How to reverse the camera motion with Vuforia 4.0 version.

Can anyone help ?

Thanks & Regards,

vamshi

 

 

How to Reverse the camera motion On Augmentation ?

May 29, 2015 - 9:39am #3

In Unity - put all the objects you want to scale into an empty GameObject. Put a script on that GameObject and call it whatever you want. In that script check the distance between the Camera and the point of view of the object....do whatever you want with the result (scale in some funky way).

float distanceToCamera = Vector3.Distance (Camera.main.transform.position, this.transform.position);

Now do something interesting with that distance. Scale up or down depending on the number getting larger or smaller

How to Reverse the camera motion On Augmentation ?

May 21, 2015 - 2:08pm #2

I wonder if you could accomplish this with a second camera.  The AR camera is used to figure out where in space it needs to be in order to render the target in the "standard" location, then you write a script that mimics this location, except that you invert the distance from the target (exercise to the reader to figure out the maximums and minimums).

The AR camera has its render mask set to not-render the 3D scene (only the video background) and the second camera renders the 3D scene (and not the background) on a second pass (set the second camera to have a higher "depth" value).

Log in or register to post comments