- Sceneform SDK cho Android có nguồn mở và được lưu trữ (github.com/google-ar/sceneform-android-sdk) với phiên bản 1.16.0.
- Trang web này (developers.google.com/sceneform) đóng vai trò là kho lưu trữ tài liệu cho phiên bản trước, Sceneform SDK for Android 1.15.0.
- Không sử dụng phiên bản 1.17.0 của Cấu phần phần mềm Maven của Sceneform.
- Có thể sử dụng các cấu phần phần mềm Maven 1.17.1. Tuy nhiên, khác với phiên bản, các cấu phần phần mềm 1.17.1 giống với các cấu phần phần mềm 1.15.0.
Bắt đầu nhanh Ảnh động cho Cảnh biểu mẫu
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Bắt đầu sử dụng ảnh động Cảnh. Tài liệu này sẽ hướng dẫn bạn cách:
- Thiết lập môi trường phát triển để hỗ trợ ảnh động
- Tải và chạy ảnh động trong ứng dụng mẫu
Hướng dẫn này giả định rằng bạn đã cài đặt và định cấu hình SDK Sceneform
cho Android. Nếu không, hãy xem nội dung Bắt đầu nhanh cho Android để biết các bước cài đặt và thiết lập.
Nếu bạn mới sử dụng ảnh động bộ xương, hãy xem phần Khái niệm về ảnh động mô hình để được giới thiệu.
Thiết lập môi trường lập trình của bạn
Xây dựng và chạy ứng dụng mẫu
Cách tạo và chạy ứng dụng mẫu Animation:
Nhập Animation mẫu vào Android Studio. Thư mục này nằm tại thư mục samples/animation
trong
Sceneform SDK.
Để xem thành phần ảnh động trong Android Studio, hãy chuyển đến
app/sampledata/models
. Các thành phần này là:
andy_dance.fbx
. Ảnh động chính là Andy hoạt hình.
andy_wave_l.fbx
. Andy vẫy tay trái dữ liệu ảnh động.
andy_wave_r.fbx
. Andy vẫy tay sang phải dữ liệu hoạt ảnh.
baseball_cap.fbx
. Mũ bóng chày của Andy.
Trong Android Studio, hãy nhấp vào Run (Chạy)
.
Chọn thiết bị của bạn làm mục tiêu triển khai rồi nhấp vào OK để chạy ứng dụng mẫu.
Trong quy trình xây dựng, Android Studio sẽ biên dịch các thành phần thành một tệp định dạng *.sfb
.
Trên thiết bị, hãy cấp quyền truy cập vào máy ảnh cho ứng dụng mẫu Animation. Sau đó, hãy thử các bước sau:
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2022-09-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2022-09-26 UTC."],[[["\u003cp\u003eThis guide explains how to set up your development environment for Sceneform animation and run a sample app demonstrating animation.\u003c/p\u003e\n"],["\u003cp\u003eYou will need Android Studio 3.1 or higher, Android SDK Platform 7.1 or higher, and the Google Sceneform Tools (Beta) plugin installed.\u003c/p\u003e\n"],["\u003cp\u003eThe sample app allows you to add an animated Andy Android model to an AR scene, trigger animations, and add/remove a hat.\u003c/p\u003e\n"],["\u003cp\u003eThe provided sample assets include a primary dancing animation, waving animations, and a baseball cap model.\u003c/p\u003e\n"],["\u003cp\u003eYou can build and run the Animation sample app by importing it into Android Studio and deploying it to a supported ARCore device.\u003c/p\u003e\n"]]],["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"],null,["# Animation for Sceneform quickstart\n\nGet started with Sceneform animation. This guide shows you how to:\n\n- Set up your development environment to support animation\n- Loading and running an animation in the sample app\n\nThis guide assumes that you have already installed and configured the Sceneform\nSDK for Android. If not, see the [Quickstart for Android](/sceneform/develop/android-quickstart)\nfor installation and setup steps.\n\nIf you are new to working with skeletal animation, see\n[Model animation concepts](/sceneform/develop/animation#model-concepts)\nfor an introduction.\n\nSet up your development environment\n-----------------------------------\n\n- Install [Android Studio](//developer.android.com/studio/) version 3.1 or higher with Android SDK Platform version 7.1 (API level 24) or higher, and make sure you've also installed the [Google Sceneform Tools (Beta) plugin](/sceneform/develop/getting-started#import-sceneform-plugin).\n- Make sure that your Android device is connected to the development machine via USB. See ARCore [Supported devices](/ar/discover/supported-devices) for detailed information.\n\nBuild and run the sample app\n----------------------------\n\nTo build and run the **Animation** sample app:\n\n1. Import the [Animation sample](//github.com/google-ar/sceneform-android-sdk/tree/v1.15.0/samples/animation)\n into Android Studio. This is located at `samples/animation` folder in the\n Sceneform SDK.\n\n2. To look at the animation assets in Android Studio, navigate to\n `app/sampledata/models`. These assets are:\n\n - `andy_dance.fbx`. Primary dancing Andy animation model.\n - `andy_wave_l.fbx`. Andy waving left animation data.\n - `andy_wave_r.fbx`. Andy waving right animation data.\n - `baseball_cap.fbx`. Andy's baseball cap.\n3. In Android Studio, click **Run** .\n\n4. Choose your device as the deployment target, and click **OK** to launch the\n sample app.\n\n As part of the build process, Android Studio compiles the assets into an\n `*.sfb` format file.\n5. On your device, grant camera access for the **Animation** sample app. Then\n try out these steps:\n\n - Find a plane, then tap anywhere on the plane to add dancing Andy to the scene.\n - To begin animating dancing Andy, tap the menu.\n - To add or remove the baseball hat from Andy's head, tap the hat icon."]]