org.jmol.g3d
public class Sphere3D extends Object
Implements high performance rendering of shaded spheres.
Drawing spheres quickly is critically important to Jmol. These routines implement high performance rendering of spheres in 3D.
If you can think of a faster way to implement this, please let us know.
There is a lot of bit-twiddling going on here, which may make the code difficult to understand for non-systems programmers.
Ellipsoid code added 4/2008 -- Bob Hanson hansonr@stolaf.eduField Summary | |
---|---|
boolean | addAllPixels |
double[] | coef |
int | depth |
int | diameter |
float[][] | dxyz |
static byte[][][] | ellipsoidShades |
Graphics3D | g3d |
int | height |
Matrix3f | mat |
static int | maxOddSizeSphere |
static int | maxSphereCache |
static int | maxSphereDiameter |
static int | maxSphereDiameter2 |
int | maxX |
int | maxY |
int | maxZ |
Matrix4f | mDeriv |
int | minX |
int | minY |
int | minZ |
static int | nIn |
static int | nOut |
Point3i[] | octantPoints |
int | offsetPbufBeginLine |
int | planeShade |
int[] | planeShades |
Point3f | ptTemp |
int | selectedOctant |
int[] | shades |
int | slab |
static int[][] | sphereShapeCache |
static int | SDIM |
static int | SHADE_SLAB_CLIPPED |
static int | SLIM |
boolean | tScreened |
int | width |
int | x |
int | y |
int | z |
int[] | zbuf |
double[] | zroot |
int | zShift |
Constructor Summary | |
---|---|
Sphere3D(Graphics3D g3d) |
Method Summary | |
---|---|
static void | createEllipsoidShades() |
static int[] | createSphereShape(int diameter) |
static void | flushSphereCache() |
static int | getEllipsoidShade(float x, float y, float z, int radius, Matrix4f mDeriv) |
int | getPlaneShade(int xCurrent, int yCurrent, double[] zroot) |
static int[] | getSphereShape(int diameter) |
void | render(int[] shades, boolean tScreened, int diameter, int x, int y, int z, Matrix3f mat, double[] coef, Matrix4f mDeriv, int selectedOctant, Point3i[] octantPoints) |
void | renderLarge() |
void | renderQuadrant(int xSign, int ySign) |
void | renderQuadrantClipped(int radius, int xSign, int ySign) |
void | renderQuadrantUnclipped(int radius, int xSign, int ySign) |
void | renderShapeClipped(int[] sphereShape) |
void | renderShapeUnclipped(int[] sphereShape) |
void | setPlaneDerivatives() |