Part 1: Export CityEngine scene to Web Scene (.3ws)
- Open scene Esri_Campus.cej
- Generate models
Have a look at the various layers in the scene:
The layer setup is essential for the Web Scene we are going to create, as the layers will be shown in the Web Viewer like in the CityEngine scene.
The scene contains five layers for the Dev HQ building: Exterior Walls, No Walls, and a floor plan layer for each of the three floors. The No Walls layer is basically empty; it will be used to enable the swipe view in the Web Scene later on.
Campus Buildings and Buildings Environment contain the surrounding buildings as shells with no interior detail.
Rocks, Trees, and Light Poles contain point data that load their respective 3D assets.
Other scene details
In addition to the actual 3D content, other scene details are exported to a Web Scene.
The view bookmarks of a CityEngine scene are exported directly to the Web Scene. All view bookmarks appear in the bookmarks menu of the Web Viewer (top left Star icon).
The camera view (camera position and view direction) that is current during export will be the initial view when the Web Scene is loaded in Web Viewer. It is therefore recommended to choose a good viewpoint before starting the Web Scene exporter.
The following shadow settings are exported to the Web Scene:
Sets the initial state for direct shadows.
Ambient Occlusion on/off:
Sets the initial state for diffuse shadows.
Ambient occlusion settings:
The four ambient occlusion settings found in the Scene Light settings in the Inspector are exported to the Web Scene and are used for the diffuse shadow settings
Make sure all layers are visible, and use drag-select to select all models in the scene.
- Start exporter File > Export Models
- Choose CityEngine WebScene.
General export options
Make sure to set the location to the models folder of the current project.
For details about the other general export options, see the exporting models in the CityEngine help manual.
The Object Interaction, Object Metadata, and Textures settings define the default behavior for all layers.
Per layer export options
Check the first column to verify that all layers will be exported. If one check box is missing, no object of this layer has been selected for the export (or the layer is invisible).
Set the layer Group Name to Dev HQ for the Exterior Walls and No Walls layers. This will enable swipe view in Web Viewer for these two layers.
The layer state of the Panorama and Terrain layers are automatically set to backdrop. This means they will always be visible and will not appear in the layer list. By setting No Walls to Hidden, we ensure that the initial visibility of the Dev HQ group will show the Exterior Walls layer.
Backdrop layers cannot be selected and are automatically set to locked. Set all other layers to pickable to ensure all objects will be selectable in the Web Scene.
We only want to show metadata on the Campus buildings, therefore set No Metadata for all other layers.
A JPG texture has been prepared specifically for the terrain and is set as Texture on the terrain layer. We can therefore use the Texture Quality option Original Textures for the terrain layer. Other layers use Scene Settings (set to Compact in the previous dialog box).
Click Finish to start the export process. The exporter will create a Web Scene file (.3ws) in the chosen output directory.
Part 2: Preview Web Scene locally
Before publishing the Web Scene, it is recommended to preview it locally. This way you can ensure correct export and layer settings, and verify the Web Scene displays as expected.
- Locate the exported Web Scene (the .3ws file) in the Navigator.
- Double-click the .3ws file.
This opens your web browser and loads the CityEngine Web Viewer with the new Web Scene. The preview will load in your systems default browser. If you want to preview in a different browser (in case your default browser does not support WebGL), you can change your systems default browser, or copy and paste the URL of the desired browser.
By default, the Web Scene preview will load Web Viewer locally, but it accesses the Web Viewer application remotely from ArcGIS Online. Alternatively, you can start the Web Scene preview in offline mode as follows:
- In the Navigator, right-click the Web Scene (the .3ws file).
- In the context menu, choose Open With 3D Web Scene Viewer (offline).
Part 3: CityEngine Web Viewer
The Web Scene as it shows in the preview Web Viewer:
Check that the layers appear as desired. Note how the layer group Dev HQ is displayed as a radio group.
- Hover over the group Dev HQ and start the swipe view by clicking the swipe icon
Swipe view shows the exterior walls on the left, and no walls on the right.
Ensure that bookmarks are displayed as expected in CityEngine Web Viewer. Hovering over the 3D viewport shows the bookmarks bar. Use the play button to play a tour through the bookmark views.
- Select one of the campus buildings, and find additional metadata in the information pane.
- Turn direct and diffuse shadows on and off in the settings pane.
- In the layer pane, hide floors 1 and 3 to see details of floor 2.
- In the search pane, search for “restroom”.
More details on CityEngine Web Viewer can be found in the ArcGIS Online help.
Part 4: Publish to ArcGIS Online
CityEngine Web Scenes can be uploaded to ArcGIS Online, where they can easily be shared with selected people or the public.
- Locate the .3ws file in the Navigator.
- Right-click Share as.
This will display the CityEngine Web Scene Package wizard.
- Check Upload package to my ArcGIS Online account.
- Name the Web Scene, or use suggested Name.
- Choose the Item Description tab.
- Enter a summary for your Web Scene item.
- Choose or enter tags for your Web Scene item.
- Click Share.
If you are not logged in yet, CityEngine will show the login dialog box for ArcGIS Online.
- Enter your credentials and sign in.
Web Scene on ArcGIS Online
Once the upload is finished, the Web Scene appears as an item in your Portal-My Content in Navigator.
- Right -click the item, and choose Open in browser
- Click Edit, and set a thumbnail image (for example, from the projects images folder).
- Click Share to set access rights for selected groups or the public.
- Click View application to start Web Viewer with Esri Campus Web Scene on ArcGIS Online
If your item is public, you can use the share button in the header of CityEngine Web Viewer to share this Web Scene on Facebook, post on Twitter, send as email, share the link itself, or embed it in a web page.