"Hubble in a bottle!" is entirely written in C. The program links OpenGL and the GLUT libraries, so that it is possible to write OpenGL objects (like triangles, spheres and maybe spaceships ;-) in front of a panel, where the particles are projected.
The rendering step for particles is implemented separately, without using OpenGL, and can be read from the source code. However, both systems are consistent with each other: OpenGL and "Hubble in a bottle!" project xyz-particles on the same screen's pixel.
Optimizations for the rendering step
The rendering step consists of a "rotation and zoom"-step, followed by a "3d clip on a one cube"-step and a "2d clip on a window plane"-step. The orthogonal projection is done implicitly in the last stage of the computation.
The fact that the whole rendering step is implemented without using OpenGL
makes optimizations easier:
ST_XForm_3dnow() substitute the
ST_XForm() routine for the projection of points using the "rotation and
zoom"-matrix. For the AMD 3dnow extension, there is a
routine as well, that speeds up the "3d clip on a cube"-step, too. It is
recommended, if you have an Intel or AMD processor, that you recompile the
source code with the
THREEDNOW (for AMD) or
SSE_EXTENSION (for Intel) flags.
All flags are located at the beginning of the file startracker.h. Press
t on your keyboard to display the
frame per seconds rate.
Three different plot modes are available. To change between them, press
on your keyboard.
Maximum density is the default mode. In this mode, the particle with maximum density along the orthogonal projection line gives the color to the screen's pixel.
The Nearest particle plot mode takes the density of the nearest particle along the projection line to assign the color.
The Estimation along line of sight mode mode is useful if the file with densities is missing. Particles along the line of sight are summed up and the sum gives the color for the pixels. This produces some aliasing effects while zooming or rotating. At the moment, this mode works only for the provided Virgo model.
Improved navigation mechanism
Navigating through the model should be easier than using TIPSY. The rotation is done pressing the left mouse button so that the model spins accordingly. To compute the rotation matrix, quaternions are used internally.
The right mouse button allows you to center the model not only in x and y directions: the model translates according to the point of maximum density (or to the nearest particle according to the plot mode) as well, unlike TIPSY.
An edge detection filter has already been implemented. Press
'F' on your keyboard
to see it in action. More to follow...
"Hubble in a bottle!" on supercomputers
Recompiling the code with the
MPI_SUPPORT flag enabled (in
changes the program into a parallel graphics tool. The server program
distributes particles to a pool of client processors. Clients are charged with
the projection step, while the server merges images together. Read here for more details.
colormap.*Computation of interpolation values for the different color maps
filemgr.*File management routines
hooks.*Empty skeleton routines for OpenGL hooks
Makefile.*Makefile for different architectures (not ready yet)
MPI_support.*Supercomputer routines (MPI library required)
sse*.*Optimized routines for the Intel architecture
startracker.*Library with rendering step
threednow.*3dnow extensions for the AMD architecture
tipsy.*Tipsy file format reader
trackball.*Trackball routines with quaternions
viewer.*Main program with OpenGL callbacks
windows_makefileDirectory with windows makefiles (not ready yet)