Log inGet started
Package

shape.nodebox

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

shape.buffer

A mesh from arrays: positions, optional triangle indices, optional normals and uvs. Without normals they are computed, smooth or flat. Indices out of range and lists of the wrong length are refused by name.

In a scene: BufferGeometry() with setAttribute('position' | 'normal' | 'uv', Float32BufferAttribute(array, itemSize)), setIndex(list) and computeVertexNormals().

InputDefaultMeaning
positions{}Flat list of vertex positions, three numbers per vertex.
indices{}Flat list of triangle corner indices from 0, three per triangle; empty takes the vertices in order, three at a time.
normals{}Flat list of vertex normals, three per vertex; empty computes them.
uvs{}Flat list of texture coordinates, two per vertex; empty gives none.
smoothtrueWith no normals given: true shares each vertex's normal across the triangles that meet at it, false gives every triangle its own.

The node answers geometry: a mesh with positions, normals and uvs. Its body is a call into the module in its own folder, so a graph of many parts cooks without a device dispatch per shape.

local geometry = BufferGeometry()
geometry:setAttribute('position', Float32BufferAttribute({ 0, 0, 0, 1, 0, 0, 0, 1, 0 }, 3))