This Sample demonstrates the use of Transformation access in the Forge Viewer, the chance to add multiple models to the same 3D scene can be achieved in a specific location by selecting either a wall point or a point on the floor depending the AC Unit that you want to snap. A new extension has been added to the GUI Toolbar of the viewer. Look for the button in the toolbar that has a ‘3 interlocked gear’ icon. Once selected you can select the recently model added and drag it along the XY Axis plane or XZ plane.
The sample is using the following Web Technologies.
- Forge Authentication API
- Forge Viewer
- Three.js
- React
- Node.js
- React-scripts
Follow these instructions to get the app running locally:
Mac OSX/Linux (Terminal)
> git clone <THIS-REPO>
> cd TO-REPO-PATH
> npm install
> export FORGE_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>
> export FORGE_CLIENT_SECRET=<<YOUR CLIENT SECRET>
> npm run watch (this runs a dev build with react-scripts which will also create css files in case you are using scss/less/sass files in --watch mode hot-realoading will be available, there is not need to refresh)
Windows (use Node.js command line from Start menu)
> git clone <THIS-REPO>
> cd TO-REPO-PATH
> npm install
> set FORGE_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>
> set FORGE_CLIENT_SECRET=<<YOUR CLIENT SECRET>
> npm run watch (this runs a dev build with react-scripts which will also create css files in case you are using scss/less/sass files in --watch mode hot-realoading will be available, there is not need to refresh)
Your browser will Open automatically at: http://localhost:3000
Important: the npm start command, this is intended for PRODUCTION with HTTPS (SSL) secure cookies.
To run a production build you need to run the following commands:
> npm run build
> npm start
If you try to deploy this on Heroku, we set a postinstall
script that will run the build
script, so there is no need to run it again, simply let Heroku run npm start
(which it does automatically) and you'll be good to go.
To deploy this project to Heroku, be sure to set your environment variables in the dashboard:
FORGE_CLIENT_ID
FORGE_CLIENT_SECRET
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Jaime Rosales D.
Forge Partner Development
Forge Developer Portal