An octasphere geometry for 3D rendering, including normals, UVs and cell indices (faces). Based on Philip Rideout's article here.
npm install primitive-octasphere
import createOctasphere from "primitive-octasphere";
const geometry = createOctasphere();
console.log(geometry);
// {
// 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], ... ]
// }
SimplicialComplex
An octasphere geometry for 3D rendering, including normals, UVs and cell indices (faces).
Array.<number>
Array.<number>
Object
Object
Geometry definition.
SimplicialComplex
An octasphere geometry for 3D rendering, including normals, UVs and cell indices (faces).
Kind: global function
Param | Type | Default |
---|---|---|
[options] | OctasphereOptions |
{} |
Array.<number>
Array.<number>
Object
Kind: global typedef
Properties
Name | Type | Default |
---|---|---|
[radius] | number |
0.5 |
[subdivisions] | number |
2 |
Object
Geometry definition.
Kind: global typedef
Properties
Name | Type |
---|---|
positions | Array.<vec3> |
normals | Array.<vec3> |
uvs | Array.<vec2> |
cells | Array.<vec3> |
MIT. See license file.