cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Finding distance from the model

SOLVED
Highlighted
Amethyst

Re: Finding distance from the model

Thank you @RolandRaytchev . Now its working fine.

But now I have another issue with my experience. What is want is that when the distance between our phone and and our model is less than 0.5 a popup should come to alert the user that it is not safe to come any closer.

 

For that purpose I used following code:

 

$scope.trigger = function() {

if (+magnitute(fargs.position[0].toFixed(2),fargs.position[1].toFixed(2),fargs.position[2].toFixed(2)) < 0.5) {

$scope.setWidgetProp('popup-2', 'visible', true)}
};

 

But it does not work..

Can you help me recifying this error.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Finding distance from the model

I will suggest to use some code like this:

 

$scope.trigger = function() {

if (+magnitute(fargs.position[0].toFixed(2),fargs.position[1].toFixed(2),fargs.position[2].toFixed(2)) < 0.5) {

//$scope.setWidgetProp('popup-2', 'visible', true)
 $scope.app.fn.triggerWidgetService("popup-2","showpopup");
//show popup
else
$scope.app.fn.triggerWidgetService("popup-2","hidepopup");
//if distance large then hide
}
};

 

So I tested and it worked in preview.

 

2020-02-10_11-52-19.gif

View solution in original post

2 REPLIES 2

Re: Finding distance from the model

I will suggest to use some code like this:

 

$scope.trigger = function() {

if (+magnitute(fargs.position[0].toFixed(2),fargs.position[1].toFixed(2),fargs.position[2].toFixed(2)) < 0.5) {

//$scope.setWidgetProp('popup-2', 'visible', true)
 $scope.app.fn.triggerWidgetService("popup-2","showpopup");
//show popup
else
$scope.app.fn.triggerWidgetService("popup-2","hidepopup");
//if distance large then hide
}
};

 

So I tested and it worked in preview.

 

2020-02-10_11-52-19.gif

View solution in original post

Re: Finding distance from the model

Thank you once again @RolandRaytchev for you reply. But even now after applying the code provided by you, it doesn't work.

Another thing is I am using trial version of vuforia studio and in 3D-Container, I do not have the option of 'extended tracking events'. Therefore I am not able to use this feature completely.

Announcements
Topics available:
AR/VR for Data Optimization AR/VR for Security and Control AR/VR for Inspection