public class GeometryFactory extends Object
GeometryFactory
instance is available as global object named: GeometryFactory.Constructor and Description |
---|
GeometryFactory(javax.media.opengl.GL gl)
Creates new
GeometryFactory . |
Modifier and Type | Method and Description |
---|---|
Axes |
createAxes(float length)
Creates axes with the following Vertex Attributes:
0 - Position (vec3) 1 - Color (vec3) |
Box |
createBox(float lengthX,
float lengthY,
float lengthZ)
Creates a box with the following Vertex Attributes:
0 - Position (vec3) 1 - Normal (vec3) 2 - Texture (vec2) |
Cone |
createCone(float radius,
float height,
int tessellation)
Creates a cone with the following Vertex Attributes:
0 - Position (vec3) 1 - Normal (vec3) |
Box |
createCube(float length)
Creates a cube with the following Vertex Attributes:
0 - Position (vec3) 1 - Normal (vec3) 2 - Texture (vec2) |
Cylinder |
createCylinder(float radius,
float height,
int tessellation)
Creates a cylinder with the following Vertex Attributes:
0 - Position (vec3) 1 - Normal (vec3) |
Line |
createLine(float p1_x,
float p1_y,
float p1_z,
float p2_x,
float p2_y,
float p2_z)
Creates a line with the following Vertex Attributes:
0 - Position (vec3) 1 - Color (vec3) |
Line |
createLine(float p1_x,
float p1_y,
float p1_z,
float p2_x,
float p2_y,
float p2_z,
float r,
float g,
float b)
Creates a line with the following Vertex Attributes:
0 - Position (vec3) 1 - Color (vec3) |
Line |
createLine(Vector3f p1,
Vector3f p2)
Creates a line with the following Vertex Attributes:
0 - Position (vec3) 1 - Color (vec3) |
Plane |
createPlane(float sizeX,
float sizeZ,
int tessellationX,
int tessellationZ)
Creates a plane with the following Vertex Attributes:
0 - Position (vec3) 1 - Normal (vec3) 2 - Texture (vec2) |
Quad |
createQuad(float halfLength)
Creates a quad with the following Vertex Attributes:
0 - Position (vec3) 1 - Texture (vec2) |
Sphere |
createSphere(float radius,
int tessellation)
Creates a sphere with the following Vertex Attributes:
0 - Position (vec3) 1 - Normal (vec3) 2 - Texture (vec2) |
Teapot |
createTeapot(int tessellation)
Creates a teapot with the following Vertex Attributes:
0 - Position (vec3) 1 - Normal (vec3) 2 - Texture (vec2) |
Teapot |
createTeapot(int tessellation,
float scaleFactor)
Creates a teapot with the following Vertex Attributes:
0 - Position (vec3) 1 - Normal (vec3) 2 - Texture (vec2) |
Torus |
createTorus(float innerRadius,
float outerRadius,
int rings,
int sides)
Creates a torus with the following Vertex Attributes:
0 - Position (vec3) 1 - Normal (vec3) 2 - Texture (vec2) |
TorusKnot |
createTorusKnot(int p,
int q,
int numSegments,
int numRings,
float radius,
float distance)
Creates a Torus Knot with the following Vertex Attributes:
0 - Position (vec3) 1 - Normal (vec3) 2 - Texture (vec2) |
TrefoilKnot |
createTrefoilKnot(int slices,
int stacks)
Creates a Trefoil Knot with the following Vertex Attributes:
0 - Position (vec3) 1 - Normal (vec3) |
public GeometryFactory(javax.media.opengl.GL gl)
GeometryFactory
.gl
- GL context.public Sphere createSphere(float radius, int tessellation)
public Box createCube(float length)
public Box createBox(float lengthX, float lengthY, float lengthZ)
public Teapot createTeapot(int tessellation)
public Teapot createTeapot(int tessellation, float scaleFactor)
public Torus createTorus(float innerRadius, float outerRadius, int rings, int sides)
public Quad createQuad(float halfLength)
public Plane createPlane(float sizeX, float sizeZ, int tessellationX, int tessellationZ)
public Line createLine(float p1_x, float p1_y, float p1_z, float p2_x, float p2_y, float p2_z, float r, float g, float b)
public Line createLine(float p1_x, float p1_y, float p1_z, float p2_x, float p2_y, float p2_z)
public Line createLine(Vector3f p1, Vector3f p2)
public Axes createAxes(float length)
public TorusKnot createTorusKnot(int p, int q, int numSegments, int numRings, float radius, float distance)
p
- number of times around its axis of rotational symmetry. (for example 2).q
- number of times around a circle in the interior of the torus. (for example 3).numSegments
- number of horizontal segments to create. (for example 64).numRings
- number of vertical rings to create. (for example 64).radius
- radius of the tube. ((for example 1.0f)distance
- distance from the center of the torus to the center of the tube. (for example 5.0f)public TrefoilKnot createTrefoilKnot(int slices, int stacks)
slices
- (for example 128)stacks
- (for example 32)public Cylinder createCylinder(float radius, float height, int tessellation)
public Cone createCone(float radius, float height, int tessellation)