Prototype application allowing you to load and preview your Autodesk Platform Services models in Unity.
The sample code consists of two projects:
-
Simple Node.js server used to list 3D models in a pre-configured APS bucket, and convert the models into the glb format with meshopt compression. To enable picking, the conversion process also embeds 32-bit object IDs in the color channel of the output geometry.
-
Unity application that communicates with the Node.js server, and uses glTFast to load and preview the generated glb files. It includes a "pointer" game object that can identify whatever object it is pointing at by parsing the object ID from the color channel.
- APS credentials (see the Create an App tutorial)
- Node.js (recommended version: LTS), and yarn
- Unity (recommended version: 2020.3.29f1)
- Terminal (for example, Windows Command Prompt, or macOS Terminal)
- Clone this repository
- Install dependencies:
yarn install
- Setup env. variables:
APS_CLIENT_ID
- your APS application client IDAPS_CLIENT_SECRET
- your APS application client secretAPS_BUCKET
- APS bucket with designs to load and display
- Run the server app:
yarn start
- Open the Unity project in the
unity/DesignPreview
subfolder - Run the Unity project; the dropdown in the UI should be populated with designs available in your configured bucket, and after selecting one of the designs from the dropdown the server will download the design, preprocess it, and finally load it into the 3D scene
Submit your question via APS Support Form.
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for more details.
Petr Broz (@ipetrbroz), Developer Advocate