Skip to content

Perktus/dna-visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Interactive 3D DNA helix visualizer

C++17 · OpenGL 3.3 · procedural geometry · post-processing

Overview

DNA Visualizer is a computer-graphics coursework project that renders a double-stranded DNA helix in real time. The codebase is split into small modules (core, dna, renderer, ui) and uses modern OpenGL: Phong shading, off-screen rendering via an FBO, and a post-processing stack.

Highlights

  • Procedural helix — nucleotide spheres, backbone tubes, base-pair bridges
  • Per-base coloring (A / T / G / C) with a Watson–Crick complementary strand
  • Arcball camera and ImGui panels for scene control
  • MutationEngine — point substitutions with on-screen highlight and history log
  • Post-processing — Sobel edge detection, FXAA, vignette

Documentation

Detailed guides live in docs/:

Document Topics
Overview Index and quick reference
Architecture Modules, main loop, data flow
Rendering Pipeline FBO, Phong shaders, post-process
DNA Model Sequences, helix params, mutations
Module Reference Public classes and APIs
Build & Development Dependencies, conventions, extending

Tech stack

Layer Libraries
Window & input GLFW
OpenGL loader GLAD
Math GLM
UI Dear ImGui
Images STB

Dependencies are fetched automatically via CMake FetchContent on first configure.

Getting started

Prerequisites

  • CMake 3.20+
  • C++17 compiler (MSVC 2019+, GCC 9+, Clang 10+)
  • GPU with OpenGL 3.3 Core support
  • Internet access on first configure

Build

Windows

cmake -S . -B build
cmake --build build --config Debug

Linux / macOS

cmake -S . -B build
cmake --build build

Release: add --config Release on Windows, or -DCMAKE_BUILD_TYPE=Release on Unix.

Run

Start the executable from the repository root — asset paths are relative to the working directory:

# Windows
.\build\Debug\dna_visualizer.exe
# Linux / macOS
./build/dna_visualizer

Controls

Input Action
Left mouse + drag Orbit camera around the helix
Mouse wheel Zoom in / out
Esc Quit
ImGui panels Sequence, mutations, lighting, animation, post-processing

ImGui panels

Panel Purpose
DNA Sequence View coding strand, regenerate helix, point mutations
Render Settings Animation, Phong lighting, filters, mutation log
Stats FPS and frame time

Rendering pipeline

┌─────────────┐     ┌──────────────┐     ┌──────────────┐     ┌─────────┐
│  3D scene   │ ──► │  Framebuffer │ ──► │ Post-process │ ──► │  ImGui  │ ──► Display
│ Phong + tex │     │ color + depth│     │ Sobel/FXAA/  │     │ overlay │
└─────────────┘     └──────────────┘     │   vignette   │     └─────────┘
                                          └──────────────┘
  1. Scene pass — helix meshes with Phong shading and a diffuse texture.
  2. Off-screen buffer — color and depth stored in an FBO.
  3. Post-process — fullscreen quad; Sobel or FXAA, then optional vignette.
  4. UI — ImGui drawn on top of the final image.

See Rendering Pipeline for shader and uniform details.

Nucleotide colors

Base Color Complement
A Red T
T Blue A
G Green C
C Yellow G

Strand A shows the coding sequence; strand B is built from its Watson–Crick complement.

Post-processing

Effect Description
Sobel Edge map from scene luminance (replaces color)
FXAA Fast approximate anti-aliasing (off while Sobel is active)
Vignette Darkens corners; strength adjustable in UI

Project structure

dna-visualizer/
├── assets/
│   ├── shaders/          # Phong, post-process, fullscreen quad
│   └── textures/
├── docs/                 # Architecture, rendering, DNA model, API reference
├── include/
│   ├── core/             # Application, Window, InputManager, Timer
│   ├── dna/              # DNASequence, HelixGeometry, MutationEngine
│   ├── renderer/         # Shader, Mesh, Camera, Texture, Framebuffer
│   └── ui/               # UILayer, UIState
├── src/
├── CMakeLists.txt
└── README.md

About

Interactive 3D DNA Simulator designed to visualize genetic sequences in a spatial, intuitive way. The interface allows full control over the view - rotate the structure with the mouse, zoom in and out, and observe it from any perspective

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors