public class EllipsoidGlyph
extends java.lang.Object
Internally, each ellipsoid is drawn by transforming an approximation to a unit sphere (with radius one) that has been precomputed and stored in an OpenGL display list.
The unit sphere is approximated by recursively subdividing the triangular faces of an octahedron. The quality of the approximation increases with the number of subdivisions, and the number of triangles increases by a factor of four with each subdivision.
Constructor and Description |
---|
EllipsoidGlyph()
Constructs an ellipsoid glyph with default quality of four subdivisions.
|
EllipsoidGlyph(int m)
Constructs an ellipsoid glyph with specified quality.
|
Modifier and Type | Method and Description |
---|---|
int |
countVertices()
Returns the number of vertices used to approximate this glyph.
|
void |
draw()
Draws a unit sphere centered at the origin.
|
void |
draw(float cx,
float cy,
float cz,
float r)
Draws a sphere centered at a specified point with specified radius.
|
void |
draw(float cx,
float cy,
float cz,
float dx,
float dy,
float dz)
Draws an axis-aligned ellipsoid centered at a specified point.
|
void |
draw(float cx,
float cy,
float cz,
float ux,
float uy,
float uz,
float vx,
float vy,
float vz,
float wx,
float wy,
float wz)
Draws an arbitrary ellipsoid centered at a specified point.
|
float[] |
getVertices()
Gets the vertices of the unit sphere used to approximate this glyph.
|
public EllipsoidGlyph()
public EllipsoidGlyph(int m)
m
- the quality = the number of subdivisions.public int countVertices()
public float[] getVertices()
public void draw()
public void draw(float cx, float cy, float cz, float r)
cx
- x coordinate of the center point.cy
- y coordinate of the center point.cz
- z coordinate of the center point.r
- radius of the sphere.public void draw(float cx, float cy, float cz, float dx, float dy, float dz)
cx
- x coordinate of the center point.cy
- y coordinate of the center point.cz
- z coordinate of the center point.dx
- semi-principal length in direction of x axis.dy
- semi-principal length in direction of y axis.dz
- semi-principal length in direction of z axis.public void draw(float cx, float cy, float cz, float ux, float uy, float uz, float vx, float vy, float vz, float wx, float wy, float wz)
cx
- x coordinate of the center point.cy
- y coordinate of the center point.cz
- z coordinate of the center point.ux
- x component of vector u.uy
- y component of vector u.uz
- z component of vector u.vx
- x component of vector v.vy
- y component of vector v.vz
- z component of vector v.wx
- x component of vector w.wy
- y component of vector w.wz
- z component of vector w.