|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.threed.jpct.Primitives
Primitives offers some (lathe) primitives (basic 3D-objects). This class
allows one to generate some objects for testing or other purposes quick and
easy. No object editing or loading is needed. The number of faces the methods
are asking for (or using the defaults) is not exactly the number of triangles
the calculated object will have but rather the number of faces of the base
object from which it has been constructed. But in lack of a better word, it's
called "faces" here.
Except for the plane, objects created by this class don't have proper texture
coordinates.
If you want proper texture coordinates for your primitives, have a look at
the ExtendedPrimitives class in the util-package.
ExtendedPrimitives
Method Summary | |
static Object3D |
getBox(float scale,
float scaleHeight)
Returns a box (a 3-dimensional rectangle). |
static Object3D |
getCone(float scale)
Returns a cone with 90 faces. |
static Object3D |
getCone(int faces,
float scale)
Returns a cone with the given number of faces. |
static Object3D |
getCone(int faces,
float scale,
float scaleHeight)
Returns a cone with the given number of faces. |
static Object3D |
getCube(float scale)
Returns a cube. |
static Object3D |
getCylinder(float scale)
Returns a cylinder with 90 faces. |
static Object3D |
getCylinder(int faces,
float scale)
Returns a cylinder with the given number of faces. |
static Object3D |
getCylinder(int faces,
float scale,
float scaleHeight)
Returns a cylinder with the given number of faces. |
static Object3D |
getDoubleCone(float scale)
Returns a double cone with 90 faces. |
static Object3D |
getDoubleCone(int faces,
float scale)
Returns a double cone with the given number of faces. |
static Object3D |
getEllipsoid(float scale,
float scaleHeight)
Returns an ellipsoid with 20 faces. |
static Object3D |
getEllipsoid(int faces,
float scale,
float scaleHeight)
Returns an ellipsoid with he given number of faces. |
static Object3D |
getPlane(int quads,
float scale)
Returns a plane consisting of (quads^2)*2 polygons each "scale" units in size. |
static Object3D |
getPyramide(float scale)
Returns a pyramide |
static Object3D |
getPyramide(float scale,
float scaleHeight)
Returns a pyramide |
static Object3D |
getSphere(float scale)
Returns a sphere with 20 faces. |
static Object3D |
getSphere(int faces,
float scale)
Returns a sphere with the given number of faces. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static Object3D getPlane(int quads, float scale)
quads
- the number of quads the plane has in x as well as in y
directionscale
- the size of each quad
public static Object3D getCone(float scale)
scale
- the scaling of the cone
public static Object3D getCone(int faces, float scale)
faces
- the number of facesscale
- the scaling of the cone
public static Object3D getCone(int faces, float scale, float scaleHeight)
faces
- the number of facesscale
- the scaling of the conescaleHeight
- the height relative to the width
public static Object3D getCylinder(float scale)
scale
- the scaling of the cylinder
public static Object3D getCylinder(int faces, float scale)
faces
- the number of facesscale
- the scaling of the cylinder
public static Object3D getCylinder(int faces, float scale, float scaleHeight)
faces
- the number of facesscale
- the scaling of the cylinderscaleHeight
- the height relative to the width
public static Object3D getPyramide(float scale)
scale
- the scaling of the pyramide
public static Object3D getPyramide(float scale, float scaleHeight)
scale
- the scaling of the pyramidescaleHeight
- the height relative to the width
public static Object3D getDoubleCone(float scale)
scale
- the scaling of the double cone
public static Object3D getDoubleCone(int faces, float scale)
faces
- the number of facesscale
- the scaling of the double cone
public static Object3D getCube(float scale)
scale
- the scaling of the cube
public static Object3D getBox(float scale, float scaleHeight)
scale
- the scaling of the boxscaleHeight
- the height relative to the width (i.e. a scaleHeight-value of
1 will return a cube).
public static Object3D getSphere(float scale)
scale
- the scaling of the sphere
public static Object3D getSphere(int faces, float scale)
faces
- the number of facesscale
- the scaling of the sphere
public static Object3D getEllipsoid(float scale, float scaleHeight)
scale
- the scaling in x-directionscaleHeight
- the scaling of the height relative to the width (1 creates a
sphere)
public static Object3D getEllipsoid(int faces, float scale, float scaleHeight)
faces
- the number of facesscale
- the scaling in x-directionscaleHeight
- the scaling of the height relative to the width (1 creates a
sphere)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |