jmvs

JMVS history and the legacy app

This is the history of JMVS from the 1999 dissertation to the 2026 modernisation, with screenshots comparing the modern app against the 2022 Java3D version. For the current app, see the README.

JMVS originally stood for Java3D Molecular Visualisation System. Java3D was replaced by libGDX in 2026. The original app is kept for posterity in legacy-app/ and still runs on macOS with ./gradlew -p legacy-app run. Tag legacy-java3d marks the code before the modernisation.

Version comparison

2026 2022
1usc.cif balls, CPK (2026) 1usc.cif balls, CPK (2022)
1usc.cif balls, group (2026) 1usc.cif balls, group (2022)
1usc.cif sticks, structure (2026) 1usc.cif sticks, structure (2022)
1usc.cif ribbons, chain (2026) 1usc.cif ribbons, chain (2022)
1usc.cif ribbons, structure (2026) 1usc.cif ribbons, structure (2022)

1usc.cif from data/, rendered by the 2026 libGDX version (left) and the 2022 Java3D version (right).

2026 modernisation

JMVS was modernised: Java 25, a multi-module Gradle 9 build, and libGDX in place of Java3D, so it no longer depends on hand-picked JARs. Structures load with RCSB’s ciftools-java, bonding uses a spatial grid with the same RasMol rules, and atoms are drawn with GPU instancing.

What’s better than 2022

Performance

Features

Correctness

Robustness and maintainability

New sample structures

Five structures were added to data/ to show off the changes (click a thumbnail for the full image):

1aon balls, chain
1aon · balls, chain
58,870 atoms in 35 chains, rotating at 43 fps: about 60 times the atom count where 2022 slowed down.
4hhb ribbons, structure
4hhb · ribbons, structure
Haemoglobin's helices, assigned per chain. 2022 matched helices by residue number across all chains.
4hhb.bcif balls, chain
4hhb.bcif · balls, chain
Loaded from BinaryCIF. Each chain, haem group and water set has its own stable colour.
3nir sticks, CPK
3nir · sticks, CPK
Crambin at 0.48 Å, with hydrogens (white). Alternate atom positions aren't duplicated.
1d3z ribbons, structure
1d3z · ribbons, structure
Ubiquitin NMR: all 10 models drawn overlaid, showing how much the structure varies.
File Shows off Result
4hhb.bcif (haemoglobin, BinaryCIF) BinaryCIF reading Identical to the text file: 14 chains, 4,779 atoms, 4,574 bonds
1aon.cif.gz (GroEL–GroES, ~59k atoms) Performance at scale Loads in 0.65 s; 43 fps in balls mode, 211 fps in ribbons (Apple Silicon, Retina resolution)
4hhb.cif (haemoglobin) Helices assigned per chain; chain colours; haem groups Four helix-rich chains, each coloured correctly
3nir.cif (crambin at 0.48 Å) Hydrogens and alternate atom positions 534 alternate-position rows reduced to 784 atoms, with no duplicates
1d3z.cif (ubiquitin, NMR) Multiple models and hydrogens All 10 models load and are drawn overlaid (there’s no model picker yet)

How it was modernised

I want to be open about this: the modernisation was done with GitHub Copilot, using Claude Opus 5.5, in three steps.

  1. Establish a baseline. Before changing anything, I had Copilot reverse-engineer the existing code into retrofit architecture docs: arc42 and ADRs describing the system as it was. Anything not evident from the code or the README is marked [Inferred] or [Assumption]. The risks and technical debt section (Java3D lock-in, macOS-only vendored JARs, O(n²) bonding, System.exit on bad input, and so on) became the to-do list for everything that followed.
  2. Plan, with my steering. In Copilot’s plan mode, using those docs and the sources, I worked through a modernisation plan. Copilot asked about the key decisions and I made the calls. These included:
    • Java 25 LTS rather than 21.
    • libGDX as the 3D engine. Copilot offered JavaFX 3D, jMonkeyEngine, raw LWJGL, or Java3D 1.7 as a stepping stone.
    • RCSB’s ciftools-java for loading structures, instead of hardening my own CIF parser or adopting BioJava.
    • A multi-module build.
    • Keeping the old app running side by side until the new one matches it.
    • Built-in display modes rather than drop-in plugin JARs.
    • CI, native installers, a performance target, and atom picking as extras.

    The plan also produced new ADRs and arc42 docs for the target architecture, plus an AGENTS.md for future coding agents.

  3. Implement on autopilot. I then let Copilot implement all the phases: build, core, scene, renderer, app, packaging. It checked its own work as it went: unit tests, golden-file tests, and checking the new bonding against the old all-pairs version on every sample file. It also rendered every mode to screenshots and viewed them, benchmarked frame rates, and ran a separate code-review agent, which found a real bug that was then fixed. Where reality differed from the plan (for example, needing a newer LWJGL for Java 25, or macOS threading), the ADRs were updated to say so.

The modernisation is complete (docs/modernisation.md); what’s next is in the roadmap. The original Java3D app is kept for posterity in legacy-app/, and tag legacy-java3d marks the code as it was before all this.

2022

Recently, I found the refactored Java source code on a hard drive and thought I’d upload it to my github account for posterity. Before doing that though I wanted to ensure it built and ran.

Getting the sources to build and run on my Apple M1 with ARM processor was a headache but I managed to find some JARs that somebody had compiled for the M1.

I added a basic gradle configuration to be able to easily build and run the sources.

To build:

gradle build

To run:

gradle run

Note, you’ll need to add the appropriate JARs for gluegen and jogl for your architecture to app/libs.

(2026: these commands are out of date. Use the Gradle wrapper, ./gradlew, rather than a separately installed gradle. This version now lives in legacy-app/ and runs with ./gradlew -p legacy-app run; the new app runs with ./gradlew :jmvs-app:run. See 2026 above.)

New additions

I also couldn’t resist doing some tinkering (helps with some Java practice):

The Java

The majority of Java here is quite old, pre-8 style. I’d like to update to more modern Java, though Java 11 appears to be the latest that will support the JARs that are provided here.

2014

For fun, I decided to learn Swift with its 3D SceneKit library and ported some of JMVS to iMVS, which has a roadmap that perhaps one day I’ll tinker with further.

2003

A few years later in 2003, having worked professionally as a Java developer, I refactored the source code around a plugin-oriented idea, more configurable, though never took this idea to its full extent, i.e. 3rd parties being able to drop in plugin jars containing new modes/colouring, for instance.

I also finally added “ribbons” mode, based on Mike Carson and Charles E Bugg’s (Algorithm for ribbon models of proteins)[https://www.sciencedirect.com/science/article/abs/pii/0263785586800108] which I never quite managed for the dissertation version.

JMVS never achieved the performance or feature set of RasMol or other software in this space, but it was a project that helped me learn some biochemistry, some C, 3D programming and creating a desktop software user experience, which were all very interesting and informative.

1999

JMVS was built back in 1998/99 for my Computer Science dissertation whose aim was to create a RasMol-like 3D molecular viewer in Java. Java3D had just come about which abstracted low level OpenGL to a more abstract Scene Graph approach, though lower level primatives were possible.

I recall RasMol’s source code, written in C, being quite difficult to understand in detail (perhaps why I am now a huge proponent of code commenting, self-explanatory variable naming etc.), though I’d never seen C before either, my degree focusing mainly on Java, and so that was half the battle.

However, I managed to find a way through to creating a tool that allowed for 3 graphics modes; balls, sticks and balls and sticks, and amino and atom colouring, with zoom and rotation. Performance was an issue once atom count got to, I recall, around 1000.