1 #ifndef INCLUDE_AL_GRAPHICS_SHAPES_HPP
2 #define INCLUDE_AL_GRAPHICS_SHAPES_HPP
47 #include "al/graphics/al_Mesh.hpp"
68 float radius = M_SQRT_1_3);
118 int addSphere(
Mesh& m,
double radius = 1,
int slices = 16,
int stacks = 16);
119 int addSphereWithTexcoords(
Mesh& m,
double radius = 1,
int bands = 16);
150 unsigned slices = 16,
unsigned cycles = 1);
178 float height = 2,
unsigned slices = 16,
float twist = 0);
191 unsigned slices = 16,
float twist = 0);
207 unsigned slices = 16,
float twist = 0);
226 double x = 0,
double y = 0);
250 double height = 2,
double x = 0,
double y = 0);
266 int Nmin = 16,
int Nmaj = 16,
double minPhase = 0);
268 int addTexQuad(
Mesh& m,
float half_width = 1,
float half_height = 1);
269 int addQuad(
Mesh& m,
float half_width = 1,
float half_height = 1);
270 int addRect(
Mesh& m,
float x,
float y,
float w,
float h);
271 int addTexRect(
Mesh& m,
float x,
float y,
float w,
float h);
Stores buffers related to rendering graphical objects.
int addIcosahedron(Mesh &m, float radius=1)
Add icosahedron as indexed triangles.
int addDisc(Mesh &m, float radius=1, unsigned slices=16)
Add a disc/regular polygon as indexed triangles.
int addIcosphere(Mesh &m, double radius=1, int divisions=2)
Add sphere produced from subdivided icosahedron as indexed triangles.
int addSphere(Mesh &m, double radius=1, int slices=16, int stacks=16)
Add sphere as indexed triangles.
int addWireBox(Mesh &m, float width, float height, float depth)
Add wireframe box as indexed lines.
int addAnnulus(Mesh &m, float inRadius=0.5, float outRadius=1, unsigned slices=16, float twist=0)
Add an annulus ("little ring") as an indexed triangle strip.
int addCone(Mesh &m, float radius=1, const Vec3f &apex=Vec3f(0, 0, 2), unsigned slices=16, unsigned cycles=1)
Add a cone/pyramid as indexed triangles.
int addDodecahedron(Mesh &m, float radius=1)
Add dodecahedron as indexed triangles.
int addTetrahedron(Mesh &m, float radius=1)
Add tetrahedron as indexed triangles.
int addPrism(Mesh &m, float btmRadius=1, float topRadius=1, float height=2, unsigned slices=16, float twist=0)
Add a prism as an indexed triangle strip.
Vec< 3, float > Vec3f
float 3-vector
int addTorus(Mesh &m, double minRadius=0.3, double majRadius=0.7, int Nmin=16, int Nmaj=16, double minPhase=0)
Add a torus as an indexed triangle strip.
int addCube(Mesh &m, bool withNormalsAndTexcoords=false, float radius=M_SQRT_1_3)
Add cube as indexed triangles.
int addSurface(Mesh &m, int Nx, int Ny, double width=2, double height=2, double x=0, double y=0)
Add a tessellated rectangular surface as an indexed triangle strip.
int addCylinder(Mesh &m, float radius=1, float height=2, unsigned slices=16, float twist=0)
Add an open cylinder as an indexed triangle strip.
int addOctahedron(Mesh &m, float radius=1)
Add octahedron as triangle vertices and indices.
int addSurfaceLoop(Mesh &m, int Nx, int Ny, int loopMode, double width=2, double height=2, double x=0, double y=0)
Add a tessellated rectangular surface with connected edges.