Logo image
Animated CV

Coming Soon!

Version 2 is nearly ready. Click the image for some screenshots and animations.

What it does

Produces OpenGL based 3D pictures of cataclysmic variables (polars, intermediate polars, and non-magnetic systems).
Uses textures for added realism (starspots, plasma, shadows).
Captures screenshots or "movies" (multiple screenshots which can be converted to animated gif's using Gimp).

What it does not

What it requires

The code was developed on Red Hat Linux 6.1/6.2 (tested with both software and hardware rendering) and also works on Dec Alpha Digital UNIX V4 (software rendering only, though the displayed colours don't quite match the Linux version - this may be because I used the more uptodate Mesa v3.4 on the Alphas). Once upon a time, it worked on Win98 using the free Borland compiler (see http://home.clara.net/paulyg/ogl.htm for details on how to use OpenGL/GLUT with this compiler). However, I have since made use of the UNIX getopt routine (to detect command line options) and unfortunately the equivalent routine is not included with the free Borland compiler. The original getopt as released by AT&T should work in its place, but I have not had time to test it.

Download & Installation

Get it here: OGL_CV.tar.gz.

(I also have local copies of the Redhat 6.2 Mesa OpenGL rpms for anyone who needs them. Libraries: Mesa-3.2-2.i386.rpm; Headers: Mesa-devel-3.2-2.i386.rpm.)

To install, just untar it, edit the Makefile so that the paths to the GL related libraries/includes are correct, then type "make all". This should create three executables, "cv" (a polar), "cv_ip" (an intermediate polar) and "cv_disc" (dwarf nova).

The executables expect to find jpeg texture images in the current directory. These are :

star_spots.jpg - secondary spots and granulation texture (made from sunspot images I found on the web).
plasma_disc.jpg - disc surface texture (made with the Gimp plasma plugin, plus a a little bit of whirl-pinch).
plasma_curt.jpg - magnetosphere texture (again made with the Gimp plasma plugin).
(The disc shadow texture, which is cast onto the secondary, is made on the fly.)
I've included textures at different resolutions (128x128pixels or 256x256pixels). Just copy which ever one you want to use to the appropriate filename. If the textures are not found by the programs they display simple filled polygons instead - which still doesn't look too bad. (NB texture images larger than 256x256 tend to crash the Utah-GLX GL Rage Pro driver om my PCs with an out of memory error. Your mileage may vary. Though why you would want them bigger than this I do not know!)

RedHat 6.2 Binaries

Some people have reported limited success in compiling the code. So I have created links to precompiled binaries for RedHat 6.2. Note these binaries still need the GL and GLUT sharable libraries installed on your PC (see the link to the Mesa rpms above).

Download the following files into the directory created when you untarred OGL_CV.tar.gz. (Don't forget to chmod u+x them to set the execute permissions.)

AM Her like: cv
IP like: cv_ip
DN like: cv_disc


Command line args:
-f -- Go fullscreen. Useful for high resolution screenshots.
Other X options remain valid (e.g. -geometry).
Right Arrow / Left Arrow - rotate CV clockwise / anticlockwise.
Up Arrow / Down Arrow - increase/decrease inclination.
t or T - toggle between textured polygons and wireframe mode.
c or C - disable/enable back face culling.
h or H - toggle hidden line removal (useful in wireframe mode only).
a or A - toggle animation on or off.
d / D - decrease / increase viewing distance to CV.
r or R - reset parameters to default values.
s or S - capture screenshot. Creates sshotn.jpg.
m or M - movie. Step through one cycle making multiple screenshots (default 40). You can read them into Gimp (v1.1 NOT v1.0) using the following script-fu: mgif.scm or tgif.scm (the latter allows you to make the background colour transparent). Just drop the scripts into your ~/.gimp-1.1/scripts directory and they appear under the Xtns -> Script-fu -> APB menu. (You probably want to change the default home directory location near the bottom of the scripts.)
w / W - increase / decrease white dwarf phase (cv_ip.c only).
x or X - toggle drawing of axes.


This was my first major OpenGL based application, and as such has grown into a slightly unpretty piece of code -- but, hey, it works! I'm sure there are many improvements that could be made : If anyone makes any tweaks/improvements then be sure to pass them back to me.



If people want to use the images/animated gifs created by the programs in talks, public understanding of science work, etc, then they are welcome to, though a little credit would be welcome.

Related software

Rob Hynes also has a number of splendid looking stills from his (soon to be released) OpenGL based binary star visualisation code. Check them out here.

If you found this software useful in anyway whatsoever then drop me a line.