|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecty25.graphics.Graphics3D
A utility class for drawing three dimensional primitives.
Constructor Summary | |
Graphics3D()
|
Method Summary | |
static void |
drawCone(GLAutoDrawable drawable,
Point3D tipp,
Point3D basee,
float radius,
int sides,
boolean capped)
Draws a cone. |
static void |
drawCylinder(GLAutoDrawable drawable,
Point3D fromm,
Point3D too,
float radius,
int sides,
boolean capped)
Draws a cylinder. |
static void |
drawCylinder(GLAutoDrawable drawable,
Vector3D fromDir,
Point3D from,
Point3D to,
Vector3D toDir,
float radius,
int sides,
boolean capped)
Draws a cylinder with a tilted top and bottom. |
static Point3D |
project(Point3D p,
Vector3D dir,
Point3D origin,
Vector3D normal)
Projects a point p along the direction dir
onto the plane that is defined by (origin ,normal ). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Graphics3D()
Method Detail |
public static void drawCylinder(GLAutoDrawable drawable, Point3D fromm, Point3D too, float radius, int sides, boolean capped)
drawable
- the drawable that this drawing operations go to.fromm
- the start position of the cylinder.too
- the end position of the cylinder.radius
- the radius of the cylinder.sides
- the number of sides the cylinder will have. It must have at
least 3 sides.capped
- determines if a cap should be drawn at the top and at the
bottom of the cyliner.public static void drawCylinder(GLAutoDrawable drawable, Vector3D fromDir, Point3D from, Point3D to, Vector3D toDir, float radius, int sides, boolean capped)
The tilt is determined by normals at the top and bottom of the cylinder.
drawable
- the drawable that this drawing operations go to.fromDir
- the normal that determines the tilt at the bottom of the
cylinder.from
- the start (bottom) position of the cylinder.to
- the end (top) position of the cylinder.toDir
- the normal that determines the tilt at the top of the
cylinder.radius
- the radius of the cylinder.sides
- the number of sides the cylinder will have. It must have at
least 3 sides.capped
- determines if a cap should be drawn at the top and at the
bottom of the cyliner.public static void drawCone(GLAutoDrawable drawable, Point3D tipp, Point3D basee, float radius, int sides, boolean capped)
drawable
- the drawable that this drawing operations go to.tipp
- the tip of the cone.basee
- the base position of the cone.radius
- the radius of the base.sides
- the number of sides the cone will have. It must have at least
3 sides.capped
- determines if a cap should be drawn at the base of the cone.public static Point3D project(Point3D p, Vector3D dir, Point3D origin, Vector3D normal)
p
along the direction dir
onto the plane that is defined by (origin
,normal
).
The normal has to be of unit length.
Returns the projected point.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |