Function cube

Generate a cube of a normalized size, i.e. all axes bounded by [-1, 1].

gfx.genmesh.algorithm.indexCollectMesh!(gfx.genmesh.algorithm.DecompResult!(gfx.genmesh.algorithm.DecompResult!(std.algorithm.iteration.MapResult!(teraflop.graphics.primitives.cube().__lambda1,gfx.genmesh.cube.CubeGenerator!(1).CubeGenerator).MapResult,gfx.genmesh.poly.GenFace!(3L,teraflop.graphics.primitives.Vertex).GenFace,gfx.genmesh.algorithm.eachTriangle).DecompResult,teraflop.graphics.primitives.Vertex,gfx.genmesh.algorithm.eachVertex).DecompResult,gfx.genmesh.algorithm.LruIndexer!(ushort,teraflop.graphics.primitives.Vertex).LruIndexer) cube (
  void ,
  void
);

Examples

Generate a Cube Mesh

import std.algorithm : map;
import std.array : array;
import std.conv : to;
import teraflop.graphics : Color, Mesh, Primitive, VertexPosColor;

auto cubeData = cube();
auto vertices = cubeData.vertices.map!(v => VertexPosColor(v.position, Color.blue)).array;
auto mesh = new Mesh!VertexPosColor(Primitive.triangleList, vertices, cubeData.indices.to!(uint[]));