BuildingSession route.
Before you start
You did the installation.The sequence
1
Make your scene
Make the scene, the camera, the renderer and the camera controls. Put the canvas in an element
that has a width and a height.
2
Start the kernel
Await
new Floorkit().setupOpenGeometry(wasmURL) one time. Do this before you create geometry.3
Add the building
Create a
BuildingSession and add session.root to the scene.4
Render
Render the scene in your loop, as you do for other objects.
Find an element in the scene
After a build, you can get the 3D object of an element by its id in the model.Text labels
Datums, dimensions and room labels draw text. Before you create them, give Floorkit your scene and a perspective camera:Clean up
When the view closes, release things in this sequence:- Stop your render loop and remove your listeners.
- Dispose the editors, if you use them.
- Remove
session.rootfrom the scene and callsession.dispose(). - Dispose your controls and your renderer.
Rules
- Do not move, turn or delete the objects below
session.root. Use an edit command. - The storey groups belong to the session. An object that you add to a storey group is not kept when the session builds that storey again.
- Do not put your own object in place of an entry of
session.currentBuild.elementsById. The session removes and disposes that object when it replaces the element. - Use one copy of Three.js for your app and for Floorkit.
- If you do not have a scene,
OpenThreegives you a ready viewer.
Next
Add a 3D editor
Let users edit in this scene.
Troubleshooting
Fix a blank canvas.