mesh-normals
Given a list of vertices and faces, generate the normals for a triangle mesh.
Last updated 7 years ago by hughsk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mesh-normals 
SYNC missed versions from official npm registry.

mesh-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

mesh-normals

Usage

require('mesh-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.

Current Tags

  • 1.0.0                                ...           latest (7 years ago)

2 Versions

  • 1.0.0                                ...           7 years ago
  • 0.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 9
Dependencies (3)
Dev Dependencies (14)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |