public class SphereRenderer
extends java.lang.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.eduModifier and Type | Field and Description |
---|---|
private double[] |
coef |
private int |
depth |
private int |
diameter |
private float[][] |
dxyz |
private Graphics3D |
g3d |
private int |
height |
private javajs.util.M3 |
mat |
private static int |
maxOddSizeSphere |
(package private) static int |
maxSphereDiameter |
(package private) static int |
maxSphereDiameter2 |
private int |
maxX |
private int |
maxY |
private int |
maxZ |
private javajs.util.M4 |
mDeriv |
private int |
minX |
private int |
minY |
private int |
minZ |
private int |
offsetPbufBeginLine |
private int |
planeShade |
private int[] |
planeShades |
private javajs.util.P3 |
ptTemp |
private int |
selectedOctant |
private static int |
SHADE_SLAB_CLIPPED |
private Shader |
shader |
private int[] |
shades |
private int |
slab |
private int |
width |
private int |
x |
private int |
y |
private int |
z |
private int[] |
zbuf |
private double[] |
zroot |
Constructor and Description |
---|
SphereRenderer(Graphics3D g3d) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
render(int[] shades,
int diameter,
int x,
int y,
int z,
javajs.util.M3 mat,
double[] coef,
javajs.util.M4 mDeriv,
int selectedOctant,
javajs.util.P3i[] octantPoints) |
private void |
renderQuadrant(int xSign,
int ySign) |
private void |
renderQuadrantClipped(int radius,
int xSign,
int ySign) |
private void |
renderQuadrantUnclipped(int radius,
int xSign,
int ySign) |
private void |
renderSphereClipped(int[] sphereShape,
int x,
int y,
int z,
int diameter) |
private void |
renderSphereUnclipped(int[] sphereShape,
int z,
int diameter) |
private final Graphics3D g3d
private final Shader shader
private int minX
private int maxX
private int minY
private int maxY
private int minZ
private int maxZ
private int x
private int y
private int z
private int diameter
private int[] shades
private static final int maxOddSizeSphere
static final int maxSphereDiameter
static final int maxSphereDiameter2
private double[] zroot
private javajs.util.M3 mat
private double[] coef
private javajs.util.M4 mDeriv
private int selectedOctant
private int planeShade
private int[] zbuf
private int width
private int height
private int depth
private int slab
private int offsetPbufBeginLine
private static final int SHADE_SLAB_CLIPPED
private final javajs.util.P3 ptTemp
private final int[] planeShades
private final float[][] dxyz
SphereRenderer(Graphics3D g3d)
void render(int[] shades, int diameter, int x, int y, int z, javajs.util.M3 mat, double[] coef, javajs.util.M4 mDeriv, int selectedOctant, javajs.util.P3i[] octantPoints)
private void renderSphereUnclipped(int[] sphereShape, int z, int diameter)
private void renderSphereClipped(int[] sphereShape, int x, int y, int z, int diameter)
private void renderQuadrant(int xSign, int ySign)
private void renderQuadrantUnclipped(int radius, int xSign, int ySign)
private void renderQuadrantClipped(int radius, int xSign, int ySign)