100 Picometers...
are equivalent to one ångström (10-10 m). And although I'm a big fan of SI units, I decided to use this euphonius measuring unit (named after the Swedish physisist Anders Jonas Ångström) as name for my little VR application for displaying the spatial structure of molecules -- after all, the sizes of atoms and the lengths of chemical bonds are in the order of magnitue of one ångström.
- Space-filling model: Atoms are represented by intersecting spheres the radii of which are proportional to the atoms' Van-der-Vaals radii.
- Ball-and-stick model: Atoms are represented by small spheres, while chemical bonds are depicted by thin sticks. Each bond's order is represented by a corresponding number of parallel sticks.
- Sticks only: Bonds are depicted as in the ball-and-sticks model, but atoms are represented only implicitly by the bonds' termini.
I just have to mention that it cost me several hours and quite a bit of vector maths until I had figured out how to determine the plane in which to place the sticks representing a higher-order bond...
Application features
Ångström comes with an integrated molecular structure database in the form of a JSON file, based on a list of "interesting" structures I found somewhere on the internet, supplemented with a few more compunds I added myself. This JSON file can be generated outside Godot using a Python script, which accesses PubChem for downloading actual structure data.
A structure can be selected for display by just browsing the catalog, by drawing a random item, or through a paged list of lexically sorted systematic and common names of the available compounds. (The latter method reveals a disadvantage of using standard 2D GUI controls in this particular VR environment: It would be much more convenient if the list's vertical scroll bar was placed at its left rather than its right border, so that one could catch a glimpse of the compund names' beginnings while scolling...)
Finally, there's a small settings dialog, through which various lighting scenarios can be selected and the audio volumes of music and sound effects can be adjusted (which is actually more like a technology demonstration than being of any practical use).
Technological basis
The application was implemented using the free Godot (version 3.3) game engine, which provides basic VR support out-of-the-box. In particular, I've used Godot's mobile VR interface, which facilitates the use of smartphones as VR headsets (aka cardboard technology) by utilizing the phone's motion sensors for tracking head movements in order to accordingly adjust the stereo image projected onto the display.
Look here!
Since most mobile VR glasses don't feature any buttons or controllers, in this application, all interactions happen through "activation by gazing". At all times, a so-called "reticle" marks the center of the field of view. If the object being looked at happens to support any kind of interactivity, the reticle alters its appearance, thus providing a visual clue regarding the object's interactive capabilities. The actual interaction is initiated either instantaneously (where sensible) or after a short delay, visualized by a progress indicator.
Since Godot doesn't support something like a reticle out-of-the-box (in spite of its otherwise impressive amount of provided functionality), custom code had to be implemented for displaying the reticle, determining the objects being looked at, and initiating a reaction on activation.
More technical things worth mentioning
As mentioned, Godot comes packed with a plethora of extremely useful building blocks for programming graphics-intensive interactive applications, but, of course, cannot cover all conceavable use cases. Here's a list of some more technical aspects which required the implementation of custom code (mostly as more or less generic object classes, or "nodes", in Godot speak):
- As previously mentioned: A reticle for highlighting and activating interactive objects
- GUI panels (with buttons, scroll bars etc.) projected into 3D space, with which the reticle may interact through synthetic mouse events
- Functions for automatically scaling and positioning objects, depending on the player's position and viewing direction
- A message bus, allowing for even further de-coupling modules than what is already possible with Godot's native support for the observer pattern
Where to buy?
The source code is available from my GitLab account; in order to build, just download a suitable version of Godot as well as the corresponding export templates and export the project as Android app. The generated .apk file can be transferred onto the smartphone through adb install -r angstrom.apk
-- provided developer mode is already activated on your phone. (Since I don't know anything about the iSomething ecosystem, I unfortunately can't provide any advice on how to get Ångström running on these devices.)
Or just drop me a note, and I'll send you a ready-build .apk file via e-mail.