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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

area target: Viewer's Location

dsgnrClarK
16-Pearl

area target: Viewer's Location

Hi, there

 

I wonder how to get the Viewer's location in Vuforia Studio, like the image below

dsgnrClarK_0-1623805543839.png

It would be critical in many of the usages.

 

Thanks in advanced.

 

BRs

ACCEPTED SOLUTION

Accepted Solutions

Hi @dsgnrClarK ,

possibly you can activate the tracking event and check the device position, up and  gaze vectors. So you could calculate the vector distance to another object (widget) .Some code like thiis:

$rootScope.$on('tracking', function( tracker,fargs  ) {
  
   console.warn(tracker);console.warn(fargs);//some info about the arguments
   $scope.setWidgetProp("label-3","text","GAZE:(x="+fargs.gaze[0]+",y="+fargs.gaze[1]+","+fargs.gaze[2]+")");
  $scope.setWidgetProp("label-4","text","Position:(x="+fargs.position[0]+",y="+fargs.position[1]+","+fargs.position[2]+")");
  $scope.setWidgetProp("label-5","text","UP:(x="+fargs.up[0]+",y="+fargs.up[1]+","+fargs.up[2]+")");
$scope.$applyAsync();
})


$scope.$on('$ionicView.afterEnter', function() {
  /****************************+
tml3dRenderer.setupTrackingEventsCommand (function(target,eyepos,eyedir,eyeup) {   
  
  $scope.view.wdg["label-3"]['text']= JSON.stringify(target)
})
  **********/
$timeout(console.warn(tml3dRenderer),1500)  
  
})

///////////////////////
$scope.app.trackingLostMessage=function(){
 $scope.setWidgetProp("label-2","text","Tracking LOST");
$scope.$applyAsync();
  }
$scope.app.trackingMessage=function(){
 $scope.setWidgetProp("label-2","text","Tracking OK");
$scope.$applyAsync();
  }

Bildschirmfoto 2021-06-16 um 14.22.51.png

Bildschirmfoto 2021-06-16 um 14.23.22.png               Bildschirmfoto 2021-06-16 um 14.24.58.png

If you want to have the arrow leading path - I think this could be done with the one of the methods of tml3dRenderer  where we have also to feed with the symbol which should be displayed so far I remember. 

Bildschirmfoto 2021-06-16 um 14.47.32.png

View solution in original post

2 REPLIES 2

Hi @dsgnrClarK ,

possibly you can activate the tracking event and check the device position, up and  gaze vectors. So you could calculate the vector distance to another object (widget) .Some code like thiis:

$rootScope.$on('tracking', function( tracker,fargs  ) {
  
   console.warn(tracker);console.warn(fargs);//some info about the arguments
   $scope.setWidgetProp("label-3","text","GAZE:(x="+fargs.gaze[0]+",y="+fargs.gaze[1]+","+fargs.gaze[2]+")");
  $scope.setWidgetProp("label-4","text","Position:(x="+fargs.position[0]+",y="+fargs.position[1]+","+fargs.position[2]+")");
  $scope.setWidgetProp("label-5","text","UP:(x="+fargs.up[0]+",y="+fargs.up[1]+","+fargs.up[2]+")");
$scope.$applyAsync();
})


$scope.$on('$ionicView.afterEnter', function() {
  /****************************+
tml3dRenderer.setupTrackingEventsCommand (function(target,eyepos,eyedir,eyeup) {   
  
  $scope.view.wdg["label-3"]['text']= JSON.stringify(target)
})
  **********/
$timeout(console.warn(tml3dRenderer),1500)  
  
})

///////////////////////
$scope.app.trackingLostMessage=function(){
 $scope.setWidgetProp("label-2","text","Tracking LOST");
$scope.$applyAsync();
  }
$scope.app.trackingMessage=function(){
 $scope.setWidgetProp("label-2","text","Tracking OK");
$scope.$applyAsync();
  }

Bildschirmfoto 2021-06-16 um 14.22.51.png

Bildschirmfoto 2021-06-16 um 14.23.22.png               Bildschirmfoto 2021-06-16 um 14.24.58.png

If you want to have the arrow leading path - I think this could be done with the one of the methods of tml3dRenderer  where we have also to feed with the symbol which should be displayed so far I remember. 

Bildschirmfoto 2021-06-16 um 14.47.32.png

Hi, @RolandRaytchev 

 

Appreciate for you help. 🙂

 

I access related properties via the code below successfully.

 

$scope.getProps = function(){
  tml3dRenderer.setupTrackingEventsCommand (function(target,eyepos,eyedir,eyeup) {}
}

 

 

Nevertheless, I couldn't make the code below works.

Nothing shown is console.

 

$rootScope.$on('tracking', function( tracker,fargs  ) {
  console.warn(tracker);
  console.warn(fargs);
})

 

 

Furthermore, would you please explain the usage about  Arrow Leading Path?

Or is there any example related to it?

 

Thanks a lot.

 

Announcements

Top Tags