取得裝置相機's 地理空間轉換功能
設定應用程式使用 Geospatial API 後,即可取得裝置相機的 GAREarth.cameraGeospatialTransform
。這個轉換作業在 GAREarth
物件中管理,包含下列資訊:
- 以經緯度表示的位置
- 海拔高度
- 方向大致上與使用者在 EUS 座標系統中面向的方向相同,其中 X+ 指向東方、Y+ 指向上方,而 Z+ 指向南方
調整姿勢以提高準確度
當裝置以預設方向直立時,由於 AR 追蹤會自然對齊,因此傾斜 (X+) 和滾動 (Z+) 角度通常會精確。不過,偏航角 (Y+) 可能會因 VPS 資料可用性和位置的時間條件而異。應用程式可能需要進行調整以提高準確度。
GARGeospatialTransform.orientationYawAccuracy
會提供 GARGeospatialTransform.eastUpSouthQTarget
的不確定半徑,以度數為單位。這個值代表當地水平偏航角 (Y+) 角度估計值的標準差。
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-02-28 (世界標準時間)。
[null,null,["上次更新時間:2025-02-28 (世界標準時間)。"],[[["Access the device camera's geospatial transform to get the user's location, altitude, and orientation in the real world."],["Adjust the yaw angle for accuracy as it can vary due to VPS data availability and local conditions."],["The `GARGeospatialTransform.orientationYawAccuracy` property provides the uncertainty radius for the yaw angle estimate."],["Use the geospatial data to place anchors and interact with the real-world environment through your AR app."]]],["After configuring the Geospatial API, the `GAREarth.cameraGeospatialTransform` provides location (latitude/longitude), altitude, and device orientation. Orientation uses the EUS coordinate system (X+ east, Y+ up, Z+ south). While pitch and roll are generally accurate, yaw can vary. `GARGeospatialTransform.orientationYawAccuracy` indicates yaw uncertainty. To proceed, use the data to place a Geospatial anchor, by obtaining the anchor's pose.\n"]]