A Molecule 3D Viewer built in Rust with no 3D engine :D
- Table of Content
- Why Quantik even exist ( °ヮ° ) ?
- Images
- Core Features ( ദ്ദി ˙ᗜ˙ )
- Built with...
- Installation & Quick Start
- Stardance Devlogs ᕙ( •̀ ᗜ •́ )ᕗ
- Development
- Boring Stuff
Quantik does exist for multiple reason : I wanted to create a 3D molecule viewer that my teacher could use in class; also because I wanted to learn how 3D work in depth; and finally to use it my self with homework (because most software are only on windows and I use a mac)
![]() 3D Molecule (Caffeine) |
![]() Example Menu |
|||
![]() Home menu |
||||
- Atoms and Bound Rendering: Atoms are drawn as spheres and bonds as cylinders (double and triple bonds are drawn as 2 or 3 parallel cylinders)
- CPK Colors & Real Atomic Radii: Each element has its own color and a size based on its van der Waals radius
- Orbit Camera: Rotate, pan and zoom around the molecule with the mouse or the keyboard
- Auto Rotate: Press
Spaceto let the molecule spin by itself (-/=to change the speed) - Hover Tooltip: Hover an atom to see its name, symbol, index, radius and molar mass
- Info Panel: Name, formula, number of atoms, number of bonds and total molar mass
- No GPU, no engine: Everything is rasterized on the CPU
- Depth Buffer: So atoms and bonds hide each other properly
- Lighting: A key light + a fill light, computed per vertex and interpolated across each triangle
- Back-face Culling: Triangles that look away from the camera are not rendered
- SSAA Anti-aliasing: Low quality (1x) while you move the camera for speed, then 3x anti-aliasing when you stop
- Redraw On Demand: The scene is only re-rendered when something changed (camera, hover, resize, new molecule)
- Atom ID Buffer: Each pixel remembers which atom drew it, that's how hovering works
.sdfFiles: Open any SDF file (.sdfor.txt) with a native file dialog- Built-in Examples: Water, Methane, Ammonia, Benzene and Ethanol are built-in (so no file is needed)
- Auto Framing: The molecule is centered and the camera distance is set from its size
- Known Names: Some PubChem CIDs are recognised (Water, Caffeine, Cocaine, Vitamin C...), the others are shown as
CID <number>
| Action | Input |
|---|---|
| Rotate | Left mouse drag / Arrow keys |
| Pan | Right mouse drag |
| Zoom | Scroll wheel / W S |
| Auto rotate | Space (speed: - / =) |
| Reset camera | R |
| Open file | Cmd/Ctrl + O |
| Example list | Cmd/Ctrl + E then 1-9 to load |
| Close list / Quit | Esc |
This project was built to help me learn Rust while creating a useful Application. Here is what I have used:
- Rust: for the whole app!
ദ്ദി(˵ •̀ ᴗ - ˵ ) ✧ minifb: for the window, the menus and the inputglam: for the vector and matrix mathsrayon: for the parallel anti-aliasing resolvefont8x8: for the bitmap font used by the UIrfd: for native file dialogs
The easiest way to get Quantik is to go to the Github Release and get the latest version ( ദ്ദി ˙ᗜ˙ ). (Otherwise you can build the project from source on your own here: Developement)
- Launch Quantik. You will see the home menu
- Use
Examples > Show list(orCmd/Ctrl+E) then press1-9to load a built-in molecule orFile > Open...(orCmd/Ctrl+O) to load an.sdffile - Drag with the left mouse button to rotate, right button to pan, scroll to zoom, and hover an atom to see its info !
ദ്ദി(˵ •̀ ᴗ - ˵ ) ✧
On Stardance you can watch the full development process via all the devlogs I've created here: Quantik Devlogs
- Clone the repository with
git clone https://github.com/wirenux/Quantik.git
cd Quantik- Then build and run with:
cargo build --release
./target/release/Quantik- Brainstorming
- Help with understanding 3D maths and hard 3D info
This project is created by @wirenux in Rust, using minifb.
Logo by @wirenux with the help of @c3a5m7
- macOS: uses the native menu bar
- Windows: shows an in-window menu bar
-
When you press
Spacethe molecule rotate (in reality it's the camera) and it also help me to know how much FPS i was getting (since i calculate FPS when the framebuffer/screen is changing) -
I choose the name Quantik because Atomik was already taken
This project is released under the MIT License



