Log in or register to post comments

UDTfixed model scale for all target sizes

September 23, 2015 - 7:35am #1

Is it possible to show a fixed sized model using UDT (irrespective of target size user chooses) ?

My problem is that, if the user takes a small/big target(10cm x 5cm or 15cm x 15cm) then the augmented content is automatically scaled to fit that target size (by vuforia), which I don't want.

My augmented content should be of same size(real world size in my case) for any marker size that user chooses run time. Ofcourse, it can be scaled by end user manually if he wants, after it shows up.

Is there any thing I can do or am missing something ? Can some one throw some light please ?

I am working with Unity 5 and c#.


UDTfixed model scale for all target sizes

September 30, 2015 - 3:59am #8

You define the Target size in this method:

mTargetBuildingBehaviour.BuildNewTarget (newTargetName, THE_SIZE_YOU_WANT);

but as you correctly said, in the UDT case (before creating the target) Vuforia does not know at what distance you are placing your real world printed paper, as it does not have a depth sensor; so, it will scale the target and the corresponding augmentation based on the number that you pass into the API method above.

Of course, as an example, when it comes to UDT, a 50cm printed paper placed at 50 cm distance from the camera will look identical to an 80cm target placed at 80cm distance from the camera, so those two objects are differently sized in the real world but are sized in the same way by Vuforia; so, your understanding is correct.

Is it a limitation of UDT ? well, I guess it's a sort of mathematical or conceptual constraint;  given that we would need a depth sensor (or some way to retrieve the real distance of the object from the camera), you can only specify an arbitrary size ( THE_SIZE_YOU_WANT ) parameter in the method above.



UDTfixed model scale for all target sizes

September 30, 2015 - 1:52am #7

Yeah, I have checked it as you have mentioned. Thanks for your effort and time.

The teapot scale remains the same in unity for any target and also with reference to another 3d object in the scene, it is proportional. Also there is no change in target geometry. So, I have the same result as you have.

But what's happening here is, while capturing the target, I bring the target to fit the complete screen and as vuforia can't know the distance between the marker and the camera it can't get the real target dimensions and hence it takes the target geometry as it was defined in unity irrespective of original target size (i.e. 80mmx80mm width as 247 and even 295mmx210mm target width also as 247) and hence the augmentation fits the target.

I guess, I need to have a way to define the real world target size that I capture, though I don't know if it is possible or is there any other possiblity ? or is it a limitation with UDT ?

UDTfixed model scale for all target sizes

September 29, 2015 - 4:35pm #6

Does the teapot geometry remain at the same scale in Unity? Test this by placing some 3d objects around the teapot. These objects should not be parented to the target. They will provide frame of reference for the teapot in the scene. I've tested this by placing 3d planes around the teapot and whichever UDT target I capture, the teapot geometry remains the same size. The captured UDT image beneath the augmentation may vary in size in relation to the teapot since the target size is not predetermined like it is with a dataset XML.

UDTfixed model scale for all target sizes

September 29, 2015 - 1:32am #5


Unfortunately, it is not the same for me even with the teapot model.

I used the UDT 5.0.5 example scene with Unity 5.0.2f3(on mac) and I have 2 sizes of markers to test (full A4 size, 8x8cm). To choose the marker, am moving my printed marker infront of the camera so that it fits the complete screen and after button tap, the teapot fits exactly to the size of marker !!

So for A4 size marker, the teapot is as big as(fits) the A4 marker and for 8cmx8cm marker, the teapot is as big as 8x8cm.

But, what I need is a predetermined scale for any kind of marker size !!


UDTfixed model scale for all target sizes

September 28, 2015 - 9:00pm #4

What happens if you place your augmentation next to the teapot in the UDT 5.0.5 sample app so that both are parented to the target? I've already verified that the teapot stays at the same scale.


UDTfixed model scale for all target sizes

September 28, 2015 - 7:39am #3

Hi dm3d,

Thanks for your reply.

Yes, am using the parent object width only. My imageTarget node which has the augmented content is linked to ImageTargetTemplate and am using it in the same way you have mentioned. Here is how my method looks-

BuildNewTarget ()
                string newTargetName = "MyUserDefinedTarget";
                mTargetBuildingBehaviour.BuildNewTarget (newTargetNameImageTargetTemplate.GetSize ().x);


UDTfixed model scale for all target sizes

September 24, 2015 - 8:52pm #2

In the UDT sample app, the BuildNewTarget() method is called with the width of the UDT ImageTarget and the teapot stays at the same scale (look in UserDefinedTargetEventHandler.cs). In the sample the width is defined at an arbitrary 247.

mTargetBuildingBehaviour.BuildNewTarget(targetName, ImageTargetTemplate.GetSize().x);

If you change this to a value of 600, you will see that the teapot is much larger than it's original scale when UDT is created at runtime:

mTargetBuildingBehaviour.BuildNewTarget(targetName, 600);

Are you using the width of the UDT ImageTarget that your augmentation is parented to when calling BuildNewTarget()?


Log in or register to post comments