This sample is demonstrating how to manage viewpoints in a viewer panel:
- Save current viewpoint (camera state) into db
- Retrieve saved viewpoints from db via REST API
- Store saved viewpoints with a single mouse-clicking on the docking panel
- node.js v8.9.4 or later
- Download and install Node.js (that will install npm as well)
- Download this repo anywhere you want
- Execute 'npm install', this command will download and install the required node modules automatically for you.
npm install
Before starting the server, you have to set the Forge credentials up.
-
Mac OSX/Linux (Terminal)
export FORGE_CLIENT_ID=<<YOUR_CLIENT_ID_FROM_DEVELOPER_PORTAL>> export FORGE_CLIENT_SECRET=<<YOUR_CLIENT_SECRET>>
-
Windows (use Node.js command line from Start menu)
set FORGE_CLIENT_ID=<<YOUR_CLIENT_ID_FROM_DEVELOPER_PORTAL>> set FORGE_CLIENT_SECRET=<<YOUR_CLIENT_SECRET>>
-
Windows (use Powershell from Start menu)
$env:FORGE_CLIENT_ID="<<YOUR_CLIENT_ID_FROM_DEVELOPER_PORTAL>>" $env:FORGE_CLIENT_SECRET="<<YOUR_CLIENT_SECRET>>"
Then Run the server
npm start
And visit http://127.0.0.1:8089
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Eason Kang
Forge Partner Development
https://developer.autodesk.com/
https://forge.autodesk.com/blog