GridHelper - Verge3D User Manual - Soft8Soft
Description: Learn how to use GridHelper in your interactive 3D apps made with Verge3D

Object3D → LineSegments →

# GridHelper

The GridHelper is an object to define grids. Grids are two-dimensional arrays of lines.

## Code Example

`const size = 10; const divisions = 10; const gridHelper = new v3d.GridHelper(size, divisions); app.scene.add(gridHelper);`

## Constructor

### GridHelper(size : Float, divisions : Float, colorCenterLine : Color | Integer | String, colorGrid : Color | Integer | String)

- size — the size of the grid. Default is `10`.
- divisions — the number of divisions across the grid. Default is `10`.
- colorCenterLine — the color of the centerline. This can be a Color, a hexadecimal value or a CSS-color name. Default is `0x444444`.
- colorGrid — the color of the lines of the grid. This can be a Color, a hexadecimal value or a CSS-color name. Default is `0x888888`.

Creates a new GridHelper of size `size` and divided into `divisions` segments per side. Colors are optional.

## Methods

See the base LineSegments class for inherited methods.

### # .dispose()

Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.

## Source

For more info on how to obtain the source code of this module see this page.