New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

primitive-quad

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

primitive-quad

an indexed quad mesh with normals and UVs

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
3K
-57.8%
Maintainers
1
Weekly downloads
 
Created
Source

primitive-quad

stable

screen

(demo)

Creates an indexed quad mesh (two triangles), with normals and UVs. It sits on the XY plane with Z=0, and positions ranging from -1.0 to 1.0.

Example

var mesh = require('primitive-quad')()

// the simplicial complex
console.log(mesh.positions, mesh.cells)

// rendering attributes
console.log(mesh.uvs)
console.log(mesh.normals)

Usage

NPM

mesh = quad([scale])

Creates a new indexed quad along the XY plane, with an optional scale number (defaults to 1).

scale can also be an [x, y] array to scale each axes independently.

The vertices are in counter-clockwise order, the UV origin is top-left (0 - 1 range), and the normals are negative along the Z axis.

The returned mesh is an object with the following data:

{
  positions: [ [x, y, z], [x, y, z], ... ],
  cells: [ [a, b, c], [a, b, c], ... ],
  uvs: [ [u, v], [u, v], ... ],
  normals: [ [x, y, z], [x, y, z], ... ]
}

License

MIT, see LICENSE.md for details.

Keywords

glo

FAQs

Package last updated on 07 Apr 2017

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