產生目標
在此章節中,您會使用先前建立的模型 .pvz 檔案來產生目標;這些目標可以在多個體驗中重複使用。在此範例中,我們會使用標準模型目標,以便您更快速完成使用案例,但如果您有意願,也歡迎使用更強效的進階或內部部屬進階模型目標。
在多數情況下,請求結構會需要仰賴 Vuforia Engine SDK API 定義。如要了解具體的 Studio 指南,請參閱 Experience Service 上的 API 文件
1. 請確保您配置的檢視符合模型目標的大小和定向。建立至少一個檢視,以容易辨識的明顯角度完整呈現模型,進一步最佳化偵測與追蹤效能。您可以使用下列任一方法在 API 上產生目標:
方法
指示
在 Postman 中
POST /ExperienceService/products/v1/target
{
"name": "Quadcopter Base",
"targetType": "standard",
"targetSdk": "10.9",
"models": [
{
"name": "Quadcopter Base SMT",
"modelId": <Model-Id>, //take the UUID that the Post Model API returned in the last step
"optimizeTrackingFor": "LOW_FEATURE_OBJECTS",
"automaticColoring": "auto",
"upVector": [0.0, 1.0, 0.0],
"views": [
{
"name": "viewpoint_0000",
"layout": "landscape",
"guideViewPosition": {
"translation": [0.19104722142219543,
0.19300971925258636,
0.2014508694410324],
"rotation": [-0.23911770032491195,
0.36964383294987413,
0.09904579601423466,
0.892399065690545]
}
}
]
}
]
}
使用 Curl 指令
curl --location 'https://<yourESURL>/ExperienceService/products/v1/target' \
--header 'X-Requested-With: any' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"name": "quadcopter base",
"targetType": "standard",
"targetSdk": "10.9",
"models": [
{
"name": "Quadcopter Base SMT",
"modelId": "yourModelUUID",
"optimizeTrackingFor": "LOW_FEATURE_OBJECTS",
"automaticColoring": "auto",
"upVector": [0.0,1.0,0.0],
"views": [
{
"name": "viewpoint_0000",
"layout": "landscape",
"guideViewPosition": {
"translation": [0.19104722142219543,
0.19300971925258636,
0.2014508694410324],
"rotation": [-0.23911770032491195,
0.36964383294987413,
0.09904579601423466,
0.892399065690545]
}
}
]
}
]
}
'
2. 回覆形式應類似下圖:
{
"targetId": "<targetId>", // Optional. Only sent in case when job to create Target is accepted.
}
3. 使用下列任一方法來取得模型目標產生的狀態:
方法
指示
在 Postman 中
GET /ExperienceService/products/v1/target/status/<targetId>
使用 Curl 指令
curl --location 'http://<yourESURL>/ExperienceService/products/v1/target/status/<yourTargetUUID>' \
--header 'Authorization: ••••••'
4. 回覆形式應類似下圖:
{
"simplifiedStatus": "queued|inProgress|completed|failed|deleted|toBeCancelled|toBeDeleted", // Dataset's current status

}
5. 重複執行步驟 1-4 以產生 Quadcopter Updated 模型的標準模型目標。請務必更新請求中的 modelId
6. 建立好必備的資產後,我們將繼續前往下個章節,然後開始在體驗中建構資料邏輯
這是否有幫助?