# three-terrain

> [three-terrain](https://terrain.gatunes.com/) ==

Latest version **0.0.10** (published 2021-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install three-terrain
pnpm add three-terrain
yarn add three-terrain
bun add three-terrain
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2021-10-14 |
| First published | 2021-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 24.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Daniel Esteban Nombela |
| Maintainers | danielesteban |

## Links

- npm: https://www.npmjs.com/package/three-terrain
- Repository: https://github.com/danielesteban/terrain
- Homepage: https://terrain.gatunes.com
- Issues: https://github.com/danielesteban/terrain/issues
- npm.io page: https://npm.io/package/three-terrain

## Dependencies (1)

- [three](https://npm.io/package/three.md) ^0.133.1

## Recent versions

- 0.0.10 (latest) — 2021-10-14
- 0.0.9 — 2021-10-14
- 0.0.8 — 2021-10-14
- 0.0.7 — 2021-10-14
- 0.0.6 — 2021-10-14
- 0.0.5 — 2021-10-13
- 0.0.4 — 2021-10-12
- 0.0.3 — 2021-10-12
- 0.0.2 — 2021-10-12
- 0.0.1 — 2021-10-12

## README

[three-terrain](https://terrain.gatunes.com/)
==

[![screenshot](screenshot.png)](https://terrain.gatunes.com/)

> A fast heightmap based voxelizer

#### Examples

 * [three-terrain.glitch.me](https://three-terrain.glitch.me/) ([source](https://glitch.com/edit/#!/three-terrain))
 * [three-terrain-generator.glitch.me](https://three-terrain-generator.glitch.me/) ([source](https://glitch.com/edit/#!/three-terrain-generator))
 * [three-terrain-walk.glitch.me](https://three-terrain-walk.glitch.me/) ([source](https://glitch.com/edit/#!/three-terrain-walk))
 
#### Installation

```bash
npm install three-terrain
```

#### Usage

```js
import { Scene } from 'three';
import Terrain from 'three-terrain';

const terrain = new Terrain({
  width: 640,
  height: 255,
  depth: 640,
  maps: {
    colorRGBheightAlpha: '/terrain.png',
    /*
      colorRGB: colormap from image RGB
      colorRGBheightAlpha: colormap from image RGB + heightmap from alpha channel
      colorRGBheightRGB: colormap from RGB + heightmap from RGB grayscale
      heightAlpha: heightmap from image alpha channel
      heightR: heightmap from image red channel
      heightRGB: heightmap from image RGB grayscale
    */
  },
});

const scene = new Scene();
scene.add(terrain);

```

---
_Source: https://npm.io/package/three-terrain · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
