Sceneform 快速入門導覽課程的動畫
開始使用場景場景動畫。本指南說明如何完成下列作業:
- 設定您的開發環境以支援動畫
- 在範例應用程式中載入並執行動畫
本指南假設您已安裝適用於 Android 的 Sceneform SDK。如果沒有,請參閱 Android 快速入門導覽課程瞭解安裝和設定步驟。
如果您是第一次使用骨骼動畫,請參閱模型動畫概念簡介。
設定開發環境
建構並執行範例應用程式
如何建構並執行「動畫」範例應用程式:
將動畫範例匯入 Android Studio。這個 ID 位於場景 SDK 中的 samples/animation
資料夾中。
如要查看 Android Studio 中的動畫素材資源,請前往 app/sampledata/models
。這些素材資源如下:
andy_dance.fbx
,主要的 Andy 舞蹈動畫模型。
andy_wave_l.fbx
。志安揮手的左動畫資料。
andy_wave_r.fbx
。志安揮手右側動畫資料。
baseball_cap.fbx
. 志安的棒球帽。
在 Android Studio 中,按一下「執行」圖示
。
選擇您的裝置做為部署目標,然後按一下「OK」啟動範例應用程式。
在建構程序中,Android Studio 會將資產編譯為 *.sfb
格式的檔案。
在您的裝置上,為「動畫」範例應用程式授予相機存取權,然後按照下列步驟操作:
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2022-09-26 (世界標準時間)。
[null,null,["上次更新時間:2022-09-26 (世界標準時間)。"],[[["This guide explains how to set up your development environment for Sceneform animation and run a sample app demonstrating animation."],["You will need Android Studio 3.1 or higher, Android SDK Platform 7.1 or higher, and the Google Sceneform Tools (Beta) plugin installed."],["The sample app allows you to add an animated Andy Android model to an AR scene, trigger animations, and add/remove a hat."],["The provided sample assets include a primary dancing animation, waving animations, and a baseball cap model."],["You can build and run the Animation sample app by importing it into Android Studio and deploying it to a supported ARCore device."]]],["To set up animation development, install Android Studio 3.1+ with Android SDK 7.1+ and the Sceneform Tools plugin. Ensure an Android device is connected. To run the sample app, import the Animation sample from the Sceneform SDK into Android Studio. The app contains animation assets: `andy_dance.fbx`, `andy_wave_l.fbx`, `andy_wave_r.fbx`, and `baseball_cap.fbx`. After building, grant camera access to the app, then tap a plane to add a dancing Andy and use the menu to animate and add/remove a hat.\n"]]