Log in or register to post comments

Scaling Rendered Object To Cover the Found Image Target On Screen

October 5, 2020 - 5:57am #1

Hi,

We are trying to render an object (a toy car which is a little bit bigger than a book) on a target image on runtime. We are creating and spawning the object with "onTargetImageFound". The problem is our rendered object is too small. We need to scale the object (which we will create when target image is found), for example, same size as the found Image Target on our camera and project it, we tried giving it a static scale however the object is not resizing (naturally) when we move the camera further from the object. Is there any way to get the scale of the ImageTarget? There are two attached images one (with a tiny white point) is the original one without applying anything, second one is scaled by us with random numbers (45,10,45). Btw the object(prefab) we try to spawn is not small normally when we drag it on the scene.

Thanks in advance.

AttachmentSize
Image icon original _size.PNG947.51 KB
Image icon we_scaled_manually.PNG1001.01 KB

Scaling Rendered Object To Cover the Found Image Target On Screen

October 12, 2020 - 1:16am #2

Hi,

If I understand the use-case correctly, you should adjust the size in Unity to fit the Image Target. If you want to adjust the size during Run-time use https://docs.unity3d.com/ScriptReference/Transform-localScale.html with a desired UI feature (button, slider etc)

Hope it helps.

Vuforia Engine Support

Log in or register to post comments