|
|
This features is only available for Models; Area Targets, Image Targets, and 3D Images are not supported.
|
{
"position": [
100.987,
-200.654,
300.321
],
"normal": [
0.6,
-0.8,
0.0
]
}
{
"position": [],
"normal": []
}
|
|
• userpick events are only available for world coordinates; they are not available for relative coordinates.
• userpick events will only be sent for the model.
|
$scope.$on('userpick', function (event, targetName, targetType, eventData) {
// event data will be empty for 3D images
//
if (eventData == []) {
console.error('Pick on unsupported object: No event data')
return
}
// the pick event gives us the item id, position and normal
//
let position = JSON.parse(eventData).position
// geometric information will not be available
// for unsupported objects
if (position.length != 3) {
console.error('Pick on unsupported object: No position data')
return
}
// put a "ball" at the point the user just touched
//
$scope.setWidgetProp("ball", "x", position[0]);
$scope.setWidgetProp("ball", "y", position[1]);
$scope.setWidgetProp("ball", "z", position[2]);
})