ChuGL geometries contain vertex data such as positions, normals, and UV coordinates.
Base geometry class, do not instantiate directly.
Geometry()
Default constructor for Geometry.
Geometry clone()
Clone the geometry, including all attributes.
void colors(float[] colors)
Set color attribute data from an array of floats; every 4 floats corresdpond to (r, g, b, a) values of a vertex color);.
void colors(vec3[] colors)
Set color attribute data from an array of vec3 (r, g, b); alpha is assumed to be 1.0.
void colors(vec4[] colors)
Set color attribute data from an array of vec4 (r, g, b, a)
void indices(int[] indices)
Sets vertex indices for indexed drawing. If not set, renderer will default to non-indexed drawing.
void normals(float[] normals)
Set normal attribute data from an array of floats; every 3 floats corresdpond to (x, y, z) values of a vertex normal.
void normals(vec3[] normals)
Set normal attribute data from an array of vec3 (x, y, z)
void positions(float[] positions)
Set position attribute data from an array of floats; every 3 floats correspond to (x, y, z) values of a vertex position.
void positions(vec3[] positions)
Set position attribute data from an array of vec3 (x, y, z)
void setAttribute(string name, int location, int numComponents, float[] data)
Set the attribute data for the given attribute location, to be passed into the vertex shader. Builtin attribute locations are POS_ATTRIB_LOC, NORM_ATTRIB_LOC, COL_ATTRIB_LOC, UV0_ATTRIB_LOC.
void uvs(float[] uvs)
Set UV attribute data from an array of floats; every pair of floats corresponds to (u, v) values (used for texture mapping)
void uvs(vec2[] uvs)
Set UV attribute data from an array of vec2 (u,v) or (s,t)
int COL_ATTRIB_LOC
No description available
int NORM_ATTRIB_LOC
No description available
int POS_ATTRIB_LOC
No description available
int UV0_ATTRIB_LOC
No description available
[ top ]
Geometry class for constructing vertex data for boxes aka cubes.
BoxGeometry()
Default constructor for BoxGeometry.
void set(float width, float height, float depth, int widthSeg, int heightSeg, int depthSeg)
Set box dimensions and subdivisions.
[ top ]
Geometry class for constructing vertex data for spheres.
SphereGeometry()
Default constructor for SphereGeometry.
void set(float radius, int widthSeg, int heightSeg, float phiStart, float phiLength, float thetaStart, float thetaLength)
Set sphere dimensions and subdivisions.
[ top ]
Geometry class for constructing vertex data for triangles.
TriangleGeometry()
Default constructor for TriangleGeometry.
void set(float theta, float width, float height)
Set triangle construction params.Theta is the angle in radians betweeen the base and the hypotenuseWidth is the length of the baseHeight is distance from base to the opposite vertex.
[ top ]
Geometry class for constructing vertex data for circles.
CircleGeometry()
Default constructor for CircleGeometry.
void set(float radius, int segments, float thetaStart, float thetaLength)
Set circle dimensions and subdivisions.
[ top ]
Geometry class for constructing vertex data for lathes (i.e. rotated curves)
LatheGeometry()
Default constructor for LatheGeometry.
void set(float[] path, int segments, float phiStart, float phiLength)
Set lathe curve, dimensions and subdivisions. Path is rotated phiLength to form a curved surfaceNOTE: path takes a float[] of alternating x,y values, describing a 2D curve in the x,y planeThese values are rotated around the y-axis to form a 3D surface.
void set(int segments, float phiStart, float phiLength)
Set lathe dimensions and subdivisions while maintaining the previously set curve.
[ top ]
Geometry class for constructing vertex data for planes.
PlaneGeometry()
Default constructor for PlaneGeometry.
void set(float width, float height, int widthSegments, int heightSegments)
Set plane dimensions and subdivisions.
[ top ]
Geometry class for constructing vertex data for toruses.
TorusGeometry()
Default constructor for TorusGeometry.
void set(float radius, float tubeRadius, int radialSegments, int tubularSegments, float arcLength)
Set torus dimensions and subdivisions.
[ top ]
Geometry class for constructing vertex data for cylinders.
CylinderGeometry()
Default constructor for CylinderGeometry.
void set(float radiusTop, float radiusBottom, float height, int radialSegments, int heightSegments, int openEnded, float thetaStart, float thetaLength)
Set cylinder dimensions and subdivisions.
[ top ]
Geometry class for providing your own vertex data. Used implicitly by GLines and GPoints.
CustomGeometry()
Default constructor for CustomGeometry.
[ top ]