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

primitive-cube

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

primitive-cube

A minimal cube geometry for 3D rendering, including normals, UVs and cell indices (faces).

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

primitive-cube

stable

A minimal cube geometry for 3D rendering, including normals, UVs and cell indices (faces).

Usage

NPM

mesh = createCube([sx, sy, sz, nx, ny, nz])

Parameters:
sx - size x, defaults to 1
sy - size y, defaults to sx
sz - size z, defaults to sx nx - num subdivisions on x axis, defaults to 1
ny - num subdivisions on y axis, defaults to sx
nz - num subdivisions on z axis, defaults to sx

Example

var createCube = require('primtivie-cube');
var cube = createCube(1, 1, 1, 3, 3, 3);

cube will have the following structure:

{
  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], ... ]
}

Demo

Download or clone this repo and run:

cd demo
npm install
npm start

License

MIT, see LICENSE.md for details.

Keywords

3d

FAQs

Package last updated on 03 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