public class Geodesic
extends java.lang.Object
The Normix3D code quantizes arbitrary vectors to the vectors of this unit sphere. normix values are then used for high performance surface normal lighting
The vertices of the geodesic sphere can be used for constructing vanderWaals and Connolly dot surfaces.
One geodesic sphere is constructed. It is a unit sphere with radius of 1.0
Many times a sphere is constructed with lines of latitude and longitude. With this type of rendering, the atom has north and south poles. And the faces are not regularly shaped ... at the poles they are triangles but elsewhere they are quadrilaterals.
A geodesic sphere is more appropriate for this type of application. The geodesic sphere does not have poles and looks the same in all orientations ... as a sphere should. All faces are equilateral triangles.
The geodesic sphere is constructed by starting with an icosohedron,
a platonic solid with 12 vertices and 20 equilateral triangles
for faces. The internal call to the private
method quadruple
will
split each triangular face into 4 faces by creating a new vertex
at the midpoint of each edge. These midpoints are still in the
plane, so they are then 'pushed out' to the surface of the
enclosing sphere by normalizing their length back to 1.0
The sequence of vertex counts is 12, 42, 162, 642, 2562.
These are identified by 'levels', that run from 0 through 4;
The vertices
are stored so that when spheres are small they can choose to display
only the first n bits where n is one of the above vertex counts.
Faces + Vertices = Edges + 2
Faces: 20, 80, 320, 1280, 5120, 20480
start with 20 faces ... at each level multiply by 4
Edges: 30, 120, 480, 1920, 7680, 30720
start with 30 edges ... also multipy by 4 ... strange, but true
Vertices: 12, 42, 162, 642, 2562, 10242
start with 12 vertices and 30 edges.
when you subdivide, each edge contributes one vertex
12 + 30 = 42 vertices at the next level
80 faces + 42 vertices - 2 = 120 edges at the next level
geodesic level 0 vertexCount= 12 faceCount=20 edgeCount=30
geodesic level 1 vertexCount= 42 faceCount=80 edgeCount=120
geodesic level 2 vertexCount= 162 faceCount=320 edgeCount=480
geodesic level 3 vertexCount= 642 faceCount=1280 edgeCount=1920
The vertices of the 'one true canonical sphere' are rotated to the current molecular rotation at the beginning of the repaint cycle. That way, individual atoms only need to scale the unit vector to the vdw radius for that atom.
Notes 27 Sep 2005
If I were to switch the representation to staring with
a tetrahedron instead of an icosohedron we would get:
Faces: 4, 16, 64, 256, 1024
Edges: 6, 24, 96, 384, 1536
Vertices: 4, 10, 34, 130, 514
If I switched to face-centered normixes then I could efficiently
Regardless, I think that face-centered normixes would also reduce
ambiguity and would speed up the normal to normix process.
I could also start with an octahedron that placed one triangle
in each 3D cartesian octant. That would push to 512 faces instead
of 256 faces, leaving me with shorts. But, it would be easier to quantize
at the first level because it would be based upon sign. And perhaps
it would be easier to take advantage of symmetry in the process of
converting from normal to normix.
Modifier and Type | Field | Description |
---|---|---|
static int |
standardLevel |
3 levels, 0 through 3
|
Constructor | Description |
---|---|
Geodesic() |
Modifier and Type | Method | Description |
---|---|---|
static void |
createGeodesic(int lvl) |
|
static short[] |
getFaceVertexes(int level) |
|
static short[][] |
getNeighborVertexesArrays() |
|
static short |
getVertexCount(int level) |
|
static Vector3f |
getVertexVector(int i) |
|
static Vector3f[] |
getVertexVectors() |
public static final int standardLevel
public static short[][] getNeighborVertexesArrays()
public static short getVertexCount(int level)
public static Vector3f[] getVertexVectors()
public static Vector3f getVertexVector(int i)
public static short[] getFaceVertexes(int level)
public static void createGeodesic(int lvl)