|
|
この機能はモデルでのみ使用できます。エリアターゲット、イメージターゲット、3D イメージではサポートされていません。
|
{
"position": [
100.987,
-200.654,
300.321
],
"normal": [
0.6,
-0.8,
0.0
]
}
{
"position": [],
"normal": []
}
|
|
• userpick イベントはワールド座標系でのみ使用でき、相対座標では使用できません。
• userpick イベントはモデルに対してのみ送信されます。
|
$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]);
})