|
AGL
0
3D graphics library
|
Functions | |
| Entity | tetrahedron () |
| Create a tetrahedron. More... | |
| Entity | cube (bool calcNorm=false, bool calcUV=false) |
| Create a cube. More... | |
| Entity | cuboid (float x=2, float y=2, float z=2, bool calcNorm=false, bool calcUV=false) |
| Create a cuboid. More... | |
| Entity | octahedron () |
| Create an octahedron. More... | |
| Entity | dodecahedron () |
| Create a dodecahedron. More... | |
| Entity | icosahedron () |
| Create an icosahedron. More... | |
| Entity | sphere (int lat=20, int lng=20, bool calcNorm=false, bool calcUV=false) |
| Create a unit sphere. More... | |
| Entity | icosphere (int subdivision=3, bool calcNorm=false) |
| Create a unit sphere. More... | |
| Entity | cylinder (float r=1, float h=2, int strips=20) |
| Create a cylinder. More... | |
| Entity | plane (float x=2, float z=2, bool calcNorm=false, bool calcUV=false) |
| Create a plane on the xz-plane. More... | |
| Entity | tessellatedPlane (int l=10, int h=10) |
| Create a plane on the xz-plane. More... | |
These functions creates some of the common shapes, including the regular polyhedrons. All these functions returns an Entity with the appropriate vertices. Optionally, for some of the shapes, you can also get the normals and texture coordinates calculated.
| Entity cube | ( | bool | calcNorm = false, |
| bool | calcUV = false |
||
| ) |
Create a cube.
| calcNorm | If true, also calculates the normals. |
| calcUV | If true, also calculates the texture coordinates. |
The cube ranges from -1 to +1 on all the axes, ie. centered at the origin and going to unit length on all the axes.
| Entity cuboid | ( | float | x = 2, |
| float | y = 2, |
||
| float | z = 2, |
||
| bool | calcNorm = false, |
||
| bool | calcUV = false |
||
| ) |
Create a cuboid.
| x | Length along the x axis. |
| y | Length along the y axis. |
| z | Length along the z axis. |
| calcNorm | If true, also calculates the normals. |
| calcUV | If true, also calculates the texture coordinates. |
The cuboid is centered at the origin and ranges from \(-\frac l2\) to \(+\frac l2\) on each axis ( \(l\) is the length for that axis).
| Entity cylinder | ( | float | r = 1, |
| float | h = 2, |
||
| int | strips = 20 |
||
| ) |
Create a cylinder.
| r | Radius of the cylinder. |
| h | Height of the cylinder. |
| strips | Number of stripes to use for the curved surface. |
| Entity dodecahedron | ( | ) |
Create a dodecahedron.
Each vertex of the dodecahedron is at a distance of \(\sqrt 3\) from the origin.
| Entity icosahedron | ( | ) |
Create an icosahedron.
Each of the vertices are at a coordinate with values of 0, \(\pm1\) and \(\pm\href{https://en.wikipedia.org/wiki/Golden_ratio}\phi\) in some order.
| Entity icosphere | ( | int | subdivision = 3, |
| bool | calcNorm = false |
||
| ) |
Create a unit sphere.
| subdivision | Number of times the icosahedron is subdivided. |
| calcNorm | If true, also calculates the normals. |
Create a unit icosphere, ie. sphere created by subdividing a icosahedron. It has triangular faces. Read more here.
| Entity octahedron | ( | ) |
Create an octahedron.
The vertices of the octahedron is at the center of the faces of the cube.
| Entity plane | ( | float | x = 2, |
| float | z = 2, |
||
| bool | calcNorm = false, |
||
| bool | calcUV = false |
||
| ) |
Create a plane on the xz-plane.
| x | Length along x-axis. |
| z | Length along z-axis. |
| calcNorm | If true, also calculates the normals. |
| calcUV | If true, also calculates the texture coordinates. |
The plane consists of just the four corner vertices at y=0.
| Entity sphere | ( | int | lat = 20, |
| int | lng = 20, |
||
| bool | calcNorm = false, |
||
| bool | calcUV = false |
||
| ) |
Create a unit sphere.
| lat | Number of latitudes. |
| lng | Number of longitudes. |
| calcNorm | If true, also calculates the normals. |
| calcUV | If true, also calculates the texture coordinates. |
Create a unit sphere in uv coordinates. A uv-sphere has quadrilateral faces formed with rings and segments, like the Earth's latitudes and longitudes. The sphere has lat rings and lng segments. Read more here.
| Entity tessellatedPlane | ( | int | l = 10, |
| int | h = 10 |
||
| ) |
Create a plane on the xz-plane.
| l | Number of segments along the x-axis. |
| h | Number of segments along the z-axis. |
This creates a tessellated plane, ie. the plane is divided into smaller square unit segments, each at y=0.
| Entity tetrahedron | ( | ) |
Create a tetrahedron.
The tetrahedron is as big such that it touches the faces or vertices of a cube.