face-normals

0.0.0 • Public • Published

face-normals experimental

Given an array of triangles' vertices, return a Float32Array of their normal vectors. Helpful for quickly calculating the the normals of a mesh (assuming it's made up of triangles).

see the demo, and how it compares to heightmap-mesher's, for some example usage.

Installation

face-normals

Usage

require('face-normals')(triangles, [output])

Takes an array-like list of triangles. Each vertex should take up 3 elements, combined into groups of 3 to make each triangle. Optionally, you can pass in an array-like output object to set the values directly. If not, a Float32Array will be created for you - either way, the new/updated array will be returned.

Readme

Keywords

none

Package Sidebar

Install

npm i face-normals

Weekly Downloads

13

Version

0.0.0

License

MIT

Last publish

Collaborators

  • hughsk