glMol v01a

Andreas Markmann


click to see large image click to see large screenshot.
This is my first stab at a molecule viewer. It is set apart from other molecule viewers by the special sphere model I use which has much fewer triangles, so the animations get much smoother.
Click on one of the the images to see big versions.

I've already used the first version of this during my talk at the 13th International Surface Science Conference at UCL.
It runs, it's stable, it's got lots of little "features" in it that don't work the way you'd expect them to.
This is work in progress, so don't expect any warranty.
Just to be on the safe side. :)

This has evolved from the demo below. Animations will be implemented soon. (Just the a question of finishing the parser, from the demo you can see that, technically, it already works.)


download

Windows build: 10 Apr 2001.
Linux version: not supported yet.


description

(from readme file)
readme file for glMol
=====================

This is a fully functioning OpenGL molecule viewer,
albeit currently without support for animated input
files (views first frame only).
This will be fixed very soon.

Version: 0.1a

usage: use option -xyz <filename> to specify an xyz
molecule file to be visualised. Without this option,
the usual demo is viewed.


KEYS
====

the following keystrokes were already available in
the original objshade:


RIGHT MOUSE button - pop-up menu.

LEFT MOUSE button - rotates object, MIDDLE moves
  light position.

I - toggles inverted mouse (y-direction) [just for
  you, Rob].

QASDFE - are motion keys,
  up/down/left/back/right/forward.

SPACE bar - toggles motion control between "flat"
  and "fly" modes.
  Try it and you'll see what I mean.

O and SHIFT-O - cycles objects (back and forth).

TG - move the object up/down.

M - toggles mouse look (get a mouse cursor to
  point at things).

123 - decrease, zero, increase speed for scene
  motion (light, object jumping and rotating.

456 - decrease, zero, increase speed for spheres
  animation.


new keystrokes in glMol:
------------------------


p - switch projection between normal and orthogonal,
  no "fisheye" effects in the latter.
  
n/N - zoom orthogonal projection in/out.

c - toggle background color black/white ("scene" must
  be toggled off to appreciate this) - for printing.
  
u - toggle animation on/off - get rid of that floating feeling.

,/SHIFT-, - inc/dec radial detail in spheres.

./SHIFT-. - inc/dec azimutal detail in shperes.

78 - dec/inc atom size (default 40% van der Waals).

90 - dec/inc total size of molecule.


Command line & Compatibility
============================

-xyz:
-----

with <filename> to specify the filename to read xyz
molecule data from. 

All files are attempted to be read from the current
directory first, then in the directory where the
executable resides.

This way, you can customise the program, most often
you will want to edit the AtomTypes.cfg file to add
types that you want to use to highlight certain
atoms.

There can be a different AtomTypes.cfg in every
directory containing an xyz file, so you don't need
to clutter one central file with all the changes.


Compatibility:
--------------

By default the program starts in 640x480 windowed
mode.


-win:
-----

The size can be changed using the usual Windows
resize (if you want to use the mouse for this, you
need to leave mouse view mode by pressing m) or at
the command line by providing the command-line
parameter -win <xres>x<yres>, for example
-win 400x200.

Try the batch file objwintiny.bat to check it out.

This will only work if your graphics card supports
windowed modes, i.e. no 3dfx.


-game:
------

You can make it fullscreen (so-called game-mode)
by starting it with the command line parametre
-game <xres>x<yres>:<colour bits>@<refresh freqency>,
for example go the Start->Run, browse to
objshade.exe and add at the end
"...\objshade.exe" -game 640x480:32@60 
In this mode, menus (rightclick) will not be
available.

Try using the batch file objlores16bpp.bat or
objlores32bpp.bat (according to your graphics card)
and play with the settings by editing them.

I encourage all voodoo II/III owners to try it out
and give a me shout if it works or not. Windowed
won't work, I guess.


-desk:
------

You can also run at the desktop resolution by
running it with the parameter objshade.exe -desk.
If you have a graphics card which is comfortable
with windowed modes (all latter day accelerator
cards should be), run objdesktopfill.bat to do
this.

Remember though that this is not real fullscreen,
just *windowed* and resized to the full desktop
size! You will see that menus and even the Start
bar are available. That means Voodoo II owners
will not get this working!


-mipmap:
--------

specify this option to turn OFF mipmapping, i.e. to
turn OFF the so-called TRIlinear filtering.
Specify this alone to turn fitering off completely or
combine with -linear to get bilinear filtering.


-linear:
--------

specify this option to turn ON linear mapping, i.e.
to turn ON the so-callel BIlinear filtering.
Ignored when -mipmap is NOT specified.


Please notify me of any problems, as I would like
to make the program template platform-independent.

mailto:a.markmann@ucl.ac.uk


Remarks
=======

Read section "-xyz" above for remarks on
customisability.

The option "-full" which does the same as "-desk" is
still supported but deprecated, as this is not a
real fullscreen (as with using the game mode
"-game" option) and I want to avoid labelling
confusions.


The menus won't work in game mode (real
full-screen). Portable quake-style OpenGL menus
are in the works.

Try out all possible menu settings, some will speed
things up, others will slow them down (up to
virtual standstill sometimes - try clipping), so
try to find your favourite settings.


If you should try sphere maps, watch them follow
your position. (yuck!)
I need to fix this.


Shadows for balls are (still) target for
optimisation, elliptical sprites should do the
trick, as they are only one versus many polys for
the potato shaped things that are drawn currently.
Shouldn't bring too many fps, however.
(Switch shadows off completely to see what I mean.)


Glu spheres have more vertices than mine but that
won't show for 1000 spheres as the difference only
goes up with the level of detail (LOD)
[O(n^2) vs O(n^1.5 or so)].
The difference is more dramatic for a high-quality
sphere as the single large one in this demo.

The algorithm is simple: use less vertices for high
declination angles to achieve a constant LOD
rather than using a constant number as glu does
(high detail near poles, which is wasted, as it
still looks bad at the equator).