# geo-3d-transform-mat4

> Transform geometry positions with a 4x4 transformation matrix.

Latest version **1.0.0** (published 2015-12-27) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install geo-3d-transform-mat4
pnpm add geo-3d-transform-mat4
yarn add geo-3d-transform-mat4
bun add geo-3d-transform-mat4
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-12-27 |
| First published | 2015-12-27 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Rye Terrell |
| Maintainers | wwwtyro |
| Keywords | stackgl, geometry |

## Links

- npm: https://www.npmjs.com/package/geo-3d-transform-mat4
- Repository: https://github.com/wwwtyro/geo-3d-transform-mat4
- Homepage: https://github.com/wwwtyro/geo-3d-transform-mat4#readme
- Issues: https://github.com/wwwtyro/geo-3d-transform-mat4/issues
- npm.io page: https://npm.io/package/geo-3d-transform-mat4

## Dependencies (3)

- [gl-vec3](https://npm.io/package/gl-vec3.md) ^1.0.3
- [geo-convert-position-format](https://npm.io/package/geo-convert-position-format.md) ^1.0.0
- [geo-identify-position-format](https://npm.io/package/geo-identify-position-format.md) ^1.0.2

## Recent versions

- 1.0.0 (latest) — 2015-12-27

## README

# geo-3d-transform-mat4

Transforms the positions of a few common geometry position formats by a
[gl-mat4](https://github.com/stackgl/gl-mat4) matrix.

Supported formats are:

* Flat arrays `[1,2,3,4,5,6]`
* Array of arrays `[[1,2,3], [4,5,6]]`
* Array of TypedArrays `[new Float32Array([1,2,3]), new Float32Array([4,5,6])]`
* TypedArray `new Float32Array([1,2,3,4,5,6])`
* [ndarray](https://www.npmjs.com/package/ndarray) `ndarray(new Float32Array([1,2,3,4,5,6]))`

## Install

```sh
npm install geo-3d-transform-mat4
```

## Example
```js
var mat4 = require('gl-mat4');
var tform = require('geo-3d-transform-mat4');

var positions = [
    [1, 0, 0],
    [0, 1, 0],
    [0, 0, 1]
];

var scale = mat4.create();
mat4.scale(scale, scale, [2,2,2]);

var out = tform(positions, scale);

// out = [
//     [2, 0, 0],
//     [0, 2, 0],
//     [0, 0, 2]
// ]
```

## API
```js
var tform = require('geo-3d-transform-mat4');
```

#### `tform(positions, matrix4)`

Returns a copy of `positions` that has been transformed by `matrix4`. The output
format will be the same as `positions` was provided in.

---
_Source: https://npm.io/package/geo-3d-transform-mat4 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
