|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.threed.jpct.util.ExtendedPrimitives
This class provides some methods to create basic 3d objects that can be used within a jPCT world. All objects have usable uv-coordinates and methods for default values (especially to create objects that fit into a 1*1*1 cube). After creation don't forget to add the object to your world, otherwise you won't see it.
Constructor Summary | |
ExtendedPrimitives()
|
Method Summary | |
static Object3D |
createBox(SimpleVector size)
Creates a cuboid with width, height and depth given as components of a SimpleVector. |
static Object3D |
createCog(int teeth)
Creates a cog that fits into a 1*1*1 cube. |
static Object3D |
createCog(int teeth,
float holeRadius,
float innerRadius,
float outerRadius,
float innerSpace,
float outerSpace,
float outerMovement,
float height)
Creates a cog. |
static Object3D |
createCone(float radius,
float height,
int faces,
boolean cap)
Creates a cone which would perfectly fit into a 1*1*1 cube. |
static Object3D |
createCone(int faces)
Creates a cone which would perfeclty fit into a 1*1*1 cube. |
static Object3D |
createCube()
Creates a cube with an edge length of 1. |
static Object3D |
createCube(float size)
Creates a cube with a given edge length. |
static Object3D |
createCylinder(float radius,
float height,
int quads,
boolean caps)
Creates a cylinder with specific radius and height. |
static Object3D |
createCylinder(int quads)
Creates a cylinder which would perfectly fit into a 1*1*1 cube. |
static Object3D |
createDisc(float xradius,
float yradius,
int vertices)
Creates a disc with a specific radius in X and in Y direction. |
static Object3D |
createDisc(float radius,
int vertices)
Creates a disc with a specific radius. |
static Object3D |
createDisc(int vertices)
Creates a disc with a size of 1*1 (so it has radius 0.5). |
static Object3D |
createEllipsoid(SimpleVector size,
int quads)
Creates an ellipsoid with given width, height and depth. |
static Object3D |
createEllipsoid(SimpleVector size,
int quads,
float uScale,
float vScale)
Creates an ellipsoid with given width, height and depth. |
static Object3D |
createPivot()
A pivot object is just another name for a dummy object that can be used to position objects by setting the pivot as parent. |
static Object3D |
createPlane(float size,
int quads)
Creates a plane. |
static Object3D |
createPlane(int quads)
Creates a plane. |
static Object3D |
createPyramid()
Creates a pyramid that would perfectly fit into a 1*1*1 cube. |
static Object3D |
createPyramid(float size)
Creates a pyramid that would perfectly fit into a specific cube. |
static Object3D |
createPyramid(float size,
float height)
Creates a pyramid with a specific ground size and height. |
static Object3D |
createSphere(float radius,
int quads)
Creates a sphere with a specific radius. |
static Object3D |
createSphere(int quads)
Creates a sphere with a radius of 0.5 (so it would perfectly fit into a 1*1*1 cube). |
static Object3D |
createSprite()
Creates a sprite of size 1*1. |
static Object3D |
createSprite(float size)
Creates a sprite of a specific size. |
static Object3D |
createSprite(float width,
float height)
Creates a sprite of a specific size. |
static Object3D |
createTorus(float radius,
float pipeRadius,
int lengthQuads,
int pipeQuads)
Creates a torus (also known as donut) around the Y-Axis. |
static Object3D |
createTorus(int lengthQuads,
int pipeQuads)
Creates a torus (also known as donut) around the Y-Axis. |
static Object3D |
createTube(float innerRadius,
float outerRadius,
float height,
int quads)
Creates a tube along the Y-Axis. |
static Object3D |
createTube(int quads)
Creates a tube along the Y-Axis. |
static void |
transformUVCoords(Object3D obj,
float uMove1,
float vMove1,
float uScale,
float vScale,
float uMove2,
float vMove2)
Moves, scales and again moves uv coords on an Object3D object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExtendedPrimitives()
Method Detail |
public static Object3D createPivot()
public static Object3D createCube()
public static Object3D createCube(float size)
size
- length of each edge
public static Object3D createBox(SimpleVector size)
size
- width, height and depth for the cubiod that should be created
public static Object3D createCylinder(int quads)
quads
- The number of quads that should be used for the cylinder. Don't use more quads than you need!
public static Object3D createCylinder(float radius, float height, int quads, boolean caps)
radius
- of the cylinderheight
- of the cylinder along Y-Axisquads
- The number of quads that should be used for the cylinder. Don't use more quads than you need!caps
- if false the cylinder won't have caps an the ends
public static Object3D createCone(int faces)
faces
- Number of faces that should be used. Don't use more faces than you need!
public static Object3D createCone(float radius, float height, int faces, boolean cap)
radius
- of the coneheight
- of the cone along the Y-Axisfaces
- Number of faces that should be used. Don't use more faces than you need!cap
- If false the cone won't have a ground.
public static Object3D createSprite()
public static Object3D createSprite(float size)
size
- of the sprite
public static Object3D createSprite(float width, float height)
width
- of the spriteheight
- of the sprite
public static Object3D createPlane(int quads)
quads
- Number of quads at each edge.
public static Object3D createPlane(float size, int quads)
size
- of the quadsquads
- Number of quads at each edge.
public static Object3D createTorus(int lengthQuads, int pipeQuads)
lengthQuads
- Number of quads that should be used along the pipe.pipeQuads
- Number of quads that should be used the pipe round.
public static Object3D createTorus(float radius, float pipeRadius, int lengthQuads, int pipeQuads)
radius
- Radius of a imaginary circle the torus should contain.pipeRadius
- Radius of the pipe.lengthQuads
- Number of quads that should be used along the pipe.pipeQuads
- Number of quads that should be used the pipe round.
public static Object3D createPyramid()
public static Object3D createPyramid(float size)
size
- of the cube in which the pyramide should perfectly fit in
public static Object3D createPyramid(float size, float height)
size
- of the ground of the pyramideheight
- of the pyramid
public static Object3D createSphere(int quads)
quads
- Number of quads that should be used for the sphere. You should seriously not use more quads than
you need!
public static Object3D createSphere(float radius, int quads)
radius
- of the spherequads
- Number of quads that should be used for the sphere. You should seriously not use more quads than
you need!
public static Object3D createEllipsoid(SimpleVector size, int quads)
size
- Vector that contains width, height and depthquads
- Number of quads that should be used for the sphere. You should seriously not use more quads than
you need!
public static Object3D createEllipsoid(SimpleVector size, int quads, float uScale, float vScale)
size
- Vector that contains width, height and depthquads
- Number of quads that should be used for the sphere. You should seriously not use more quads than
you need!uScale
- texture u scale, default is 2fvScale
- texture v scale, default is 1f
public static Object3D createDisc(int vertices)
vertices
- Number of vertices that should be used.
public static Object3D createDisc(float radius, int vertices)
radius
- of the diskvertices
- Number of vertices that should be used.
public static Object3D createDisc(float xradius, float yradius, int vertices)
xradius
- Radius along the X-Axis.yradius
- Radius along the Y-Axis.vertices
- Number of vertices that should be used.
public static Object3D createCog(int teeth)
teeth
- Number of teeth.
public static Object3D createCog(int teeth, float holeRadius, float innerRadius, float outerRadius, float innerSpace, float outerSpace, float outerMovement, float height)
teeth
- Number of teethholeRadius
- Radius of the hole within the cog.innerRadius
- Radius without the theeth.outerRadius
- Radius with the teeth.innerSpace
- Factor of the size between teeth. Default is 1.outerSpace
- Factor of the size of teeth. Default is 1.outerMovement
- Turning of the teeth in radian. Default is 0.height
- Heihgt of the cog.
public static Object3D createTube(int quads)
quads
- Number of quads that should be used. Don't use more than you need!
public static Object3D createTube(float innerRadius, float outerRadius, float height, int quads)
innerRadius
- Radius of the cylinder.outerRadius
- Radius of the hole.height
- Heihgt of the cylinder.quads
- Number of quads that should be used. Don't use more than you need!
public static void transformUVCoords(Object3D obj, float uMove1, float vMove1, float uScale, float vScale, float uMove2, float vMove2)
obj
- object whom uv coords should be scaleduMove1
- u movement before scalingvMove1
- v movement before scalinguScale
- scale factor for u coordsvScale
- scale factor for v coordsuMove2
- u movement after scalingvMove2
- v movement after scaling
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |