com.ryanm.glvisualiser.imp
Class Sphere
java.lang.Object
com.ryanm.glvisualiser.GLObject
com.ryanm.glvisualiser.imp.UniformObject
com.ryanm.glvisualiser.imp.Sphere
- All Implemented Interfaces:
- Configurable, ValueListener
public class Sphere
- extends UniformObject
It's a sphere, centered on the origin, and with radius 1
- Author:
- ryanm
| Fields inherited from class com.ryanm.glvisualiser.GLObject |
dirty |
|
Method Summary |
protected void |
constructGeometry(javax.media.opengl.GLAutoDrawable drawable)
This method should be overridden with calls that draw the
geometry of the object. |
int |
getSubdivisions()
Gets the number of subdivisions in this sphere |
void |
setSubdivisions(int sub)
Sets the number of vertical and horizontal subdivisions of the
sphere. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Sphere
public Sphere(GLVisualiser drawable,
GLMaterial material,
int subdivisions)
- Standard constructor
- Parameters:
drawable - The GL context to build inmaterial - The material to render the sphere withsubdivisions - The number of subdivisions. More = better
looking/slower
constructGeometry
protected void constructGeometry(javax.media.opengl.GLAutoDrawable drawable)
- Description copied from class:
GLObject
- This method should be overridden with calls that draw the
geometry of the object. NB: It should not set any colour or
material properties
- Specified by:
constructGeometry in class GLObject
- Parameters:
drawable - The GL/GLU context to use
setSubdivisions
public void setSubdivisions(int sub)
- Sets the number of vertical and horizontal subdivisions of the
sphere. More == nicer/slower, less == ugly/speedy. This will
recompile the display lists, so don't do it too often.
- Parameters:
sub - The number of subdivisions
getSubdivisions
public int getSubdivisions()
- Gets the number of subdivisions in this sphere
- Returns:
- The number of vertical and horizontal subdivisions