# DomeGeometry

Class · extends [`SphereGeometry`](https://api.playcanvas.com/engine/classes/SphereGeometry.md) · category: Graphics

Source: https://github.com/playcanvas/engine/blob/f059dc005842f76e052cdf44d8370c8c7ec475ac/src/scene/geometry/dome-geometry.js#L33

A procedural dome-shaped geometry.

Typically, you would:

1. Create a DomeGeometry instance.
2. Generate a [Mesh](https://api.playcanvas.com/engine/classes/Mesh.md) from the geometry.
3. Create a [MeshInstance](https://api.playcanvas.com/engine/classes/MeshInstance.md) referencing the mesh.
4. Create an [Entity](https://api.playcanvas.com/engine/classes/Entity.md) with a [RenderComponent](https://api.playcanvas.com/engine/classes/RenderComponent.md) and assign the [MeshInstance](https://api.playcanvas.com/engine/classes/MeshInstance.md) to it.
5. Add the entity to the [Scene](https://api.playcanvas.com/engine/classes/Scene.md).

```javascript
// Create a mesh instance
const geometry = new DomeGeometry();
const mesh = Mesh.fromGeometry(app.graphicsDevice, geometry);
const material = new StandardMaterial();
const meshInstance = new MeshInstance(mesh, material);

// Create an entity
const entity = new Entity();
entity.addComponent('render', {
    meshInstances: [meshInstance]
});

// Add the entity to the scene hierarchy
app.scene.root.addChild(entity);
```

## Constructors

### constructor

```ts
new DomeGeometry(opts?: object)
```

Create a new DomeGeometry instance.

By default, the constructor creates a dome with a radius of 0.5, 16 latitude bands and 16
longitude bands. The dome is created with UVs in the range of 0 to 1.

**Parameters**

- `opts` (`object`, optional, default `{}`): Options object.
    - `opts.latitudeBands` (`number`, optional): The number of divisions along the latitudinal axis of
      the sphere. Defaults to 16.
    - `opts.longitudeBands` (`number`, optional): The number of divisions along the longitudinal axis of
      the sphere. Defaults to 16.

**Example**

```ts
const geometry = new DomeGeometry({
    latitudeBands: 32,
    longitudeBands: 32
});
```

## Inherited from [SphereGeometry](https://api.playcanvas.com/engine/classes/SphereGeometry.md)

- `blendIndices: ArrayLike<number> | undefined`
- `blendWeights: ArrayLike<number> | undefined`
- `colors: ArrayLike<number> | undefined`
- `tangents: ArrayLike<number> | undefined`
- `calculateNormals(): void`
- `calculateTangents(): void`
