Function quad

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

auto quad(std.typecons.Flag!("normals") normals = Yes.normals)() @property;

Examples

Generate a square quadrilateral Mesh

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

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