Vertex Viewer SDK
    Preparing search index...

    Class Scene

    A class that represents the Scene that has been loaded into the viewer. On it, you can retrieve attributes of the scene, such as the camera. It also contains methods for updating the scene and performing requests to rerender the scene.

    Index
    sceneId: string
    sceneViewId: string
    • An instance of the current camera of the scene. The camera provides a number of methods that can be used in combination with the render method to make programmatic updates to the scene's camera.

      Returns Camera

      const viewer = document.querySelector('vertex-viewer');
      const scene = await viewer.scene();
      const camera = scene.camera();

      // Fit the camera to the visible bounding box of the scene with a 1 second animation
      await camera.viewAll().render({ animation: { milliseconds: 1000 } });

      Camera for more information on available camera operations.

    • Returns an executor that accepts a function as a parameter that contains one or more operations to apply to items or annotations in the scene view. The operations will be applied transactionally.

      Returns SceneElementsOperationExecutor

      const viewer = document.querySelector('vertex-viewer');
      const scene = await viewer.scene();

      // Deselect everything, then select a specific scene item by ID
      await scene.elements(op => [
      op.items.where(q => q.all()).deselect(),
      op.annotations.where(q => q.all()).deselect(),
      op.items.where(q => q.withItemId('item-id')).select(),
      ]).execute();
      • RootQuery for more information on available queries on scene items.
      • SceneItemOperationsBuilder for more information on available operations to the scene items.
      • PmiAnnotationRootQuery for more information on available queries on PMI annotations.
      • PmiAnnotationOperationsBuilder for more information on available operations to the PMI annotations.