Start a new topic

distance between targets

I am using distance between targets feature of Xamarin wikitude sdk v7.

While calculating the distance between 2 targets I am getting target name correctly but distance as 0. 

Please provide me with the solution.

waiting for your response.....!!!

Good morning,

did you provide physical heights for your image targets? You can do so either by specifying them when creating the wt3 file or by setting them explicitly in the JavaScript code. The unit is millimeters.

Here's an excerpt from the "Distance Between Targets" sample doing the latter:


var targetCollectionResource = new AR.TargetCollectionResource("assets/");

var tracker = new AR.ImageTracker(targetCollectionResource, {
    maximumNumberOfConcurrentlyTrackableTargets: 5,
    onDistanceChangedThreshold: 0,
    physicalTargetImageHeights: { // the physical target image height is required to get the correct distance between targets
        diplodocus: 82,
        spinosaurus: 82,
        triceratops: 82,
        tyrannosaurus: 82
    onTargetsLoaded: this.worldLoaded,
    onError: function (errorMessage) {


- Daniel

Login or Signup to post a comment