JSPM

vertex.gl

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q18817F
  • License MIT

procedural geometry generator for graphic pipline.

Package Exports

  • vertex.gl

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vertex.gl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

vertex.gl

A procedural geometry generator for graphic pipline. It will generate a single buffer with positions, uvs and indices supportted. You can calculate normal in fragment shader to do the lightting stuff.

Currently only a crystal like geometry is supported. Hopefully I'll have time to add more interesting things.

Have fun!

一个随机几何体顶点生成器,可用于创意编程之类的捣鼓。

生成的单个几何体包括位置、纹理坐标2种顶点,包含索引。没有生成法线,可以在片元着色器中用微分计算法线处理光照。

目前仅支持水晶簇几何体,希望能持续填坑,增加更多随机几何体样式。

Sample

Crystal

Blue Crystal with 45 degree distribution limitition. 27个单晶45度随机分布的蓝色水晶簇。

canvas-preview

Red Crystal with 180 degree distribution limitition. 77个单晶180度随机分布的红色水晶簇。

canvas-preview

Usage

Install

npm install -i vertex.gl

API reference

const VTX = require('vertex.gl);

//generate a crystal geometry buffer with 27 pyramids and a random distribution angle of 45 degree.
const vertexBuffer = VTX.cristals(27, 45);

const positions = vertexBuffer.positions;
const uvs = vertexBuffer.uvs;
const indices = vertexBuffer.indics;

//do the rendering stuff ...