Hi

i am able to getting distance but that values are too big, is that values in pixel format, or millimeeters or  ?

regards

Nagaraju

This is something that you'll have to develop your own calculations for, but it's relatively easy. The scene units are defined using the width value that you provide to the TMS when creating your trackable. So if you have a target that's 10cm wide and define the trackable width as 10, then your scene unit is equivalent to a cm for that target. If you define the trackable width using another unit, such as pixels, you'll need to determine the conversion between pixels and cm for a given target - which would be pixel_width / 10 in this example.

To get the real-world distance of the device from the target you would need to know the printed size of the target. Then you could find the ratio between the defined width of the target and the printed width of the target and use this as a multiplier for the distance. Note that Vuforia has no way of determining the real-world size of the target it is tracking. A 10 inch-wide target and a 5 inch-wide target might track equally well, and look identical to the tracker when the device is moved so the target fills the screen.

thanx

but i need real world distance not in scene units, so can you past finding real world distance code please.

regards

Nagaraju

thanx

but i need real world distance not in scene units, so can you past finding real world distance code please.

regards

Nagaraju

Here you go ..

`#include <math.h>;  ...  QCAR::Matrix34F pose = trackable->getPose();  QCAR::Vec3F position(pose.data[3], pose.data[7], pose.data[11]);  float distance = sqrt(position.data[0] * position.data[0] +  position.data[1] * position.data[1] +  position.data[2] * position.data[2]);  LOG("distance: %f", distance);`

Can you past that code dude, finding distance with realworld values

When calculating distance from the pose data, your result will be in scene units which are established by the value that you define for the width of your target.

To get the real-world distance of the device from the target you would need to know the printed size of the target. Then you could find the ratio between the defined width of the target and the printed width of the target and use this as a multiplier for the distance. Note that Vuforia has no way of determining the real-world size of the target it is tracking. A 10 inch-wide target and a 5 inch-wide target might track equally well, and look identical to the tracker when the device is moved so the target fills the screen.