Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

geo-3d-transform-mat4

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geo-3d-transform-mat4

Transform geometry positions with a 4x4 transformation matrix.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
42
increased by40%
Maintainers
1
Weekly downloads
 
Created
Source

geo-3d-transform-mat4

Transforms the positions of a few common geometry position formats by a 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 ndarray(new Float32Array([1,2,3,4,5,6]))

Install

npm install geo-3d-transform-mat4

Example

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

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.

Keywords

FAQs

Package last updated on 27 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc