Skip to content

TATP-233/star_rotation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Star Rotation

An OpenGL-based stellar spiral rotation effect.

spirals

中文文档

Report

Features

  1. Multiple stars rotate around a center point
  2. Stars have different colors
  3. Stars rotate and spread out along spiral paths
  4. Implementation of three different spiral types:
    • Archimedes spiral: r = a + bθ
    • Fermat spiral: r = a√θ
    • Logarithmic spiral: r = ae^(bθ)

Wikipedia references:

Technical Highlights

  • Uses modern OpenGL rendering pipeline
  • Implements star rendering with GLSL shaders
  • Uses texture mapping for star patterns
  • Employs additive blending for overlapping star colors
  • Dynamically calculates transparency based on star brightness

Compilation & Execution

Requirements

  • C++17 compatible compiler
  • CMake 3.10+
  • OpenGL 3.3+
  • GLEW
  • GLFW3
  • GLM

Build Steps

mkdir build
cd build
cmake ..
make

Command Line Arguments

The program supports the following command line arguments:

Usage: ./star_rotation [options]
Options:
  -a       Use Archimedes spiral
  -f       Use Fermat spiral
  -l       Use Logarithmic spiral
  -all     Use all spiral types (default)
  -h       Display help information

For example, to display only the Archimedes spiral:

./star_rotation -a

Project Structure

star_rotation/
├── include/              # Header files
│   ├── shader.h          # Shader class
│   ├── spiral.h          # Spiral class
│   ├── star.h            # Star class
│   └── stb_image.h       # Image loading library
├── src/                  # Source files
│   ├── main.cpp          # Main program
│   ├── shader.cpp        # Shader implementation
│   ├── spiral.cpp        # Spiral implementation
│   ├── star.cpp          # Star implementation
│   └── stb_image.cpp     # Image loading implementation
├── shaders/              # GLSL shader files
│   ├── star.vert         # Vertex shader
│   └── star.frag         # Fragment shader
├── texture/              # Texture files
│   └── Star.bmp          # Star texture
├── CMakeLists.txt        # CMake configuration file
├── README.md             # Project description
└── report.md             # Technical report

Visual Effect

When running the program, you will see multiple stars of different colors rotating and spreading out along spiral paths. The colors of the stars vary, and overlapping areas produce additive color effects, creating a vibrant visual display.

Extensions & Customization

You can customize the effect by modifying the following parameters:

  • Adjust spiral parameters in main.cpp to change the paths
  • Modify the createStars() function parameters to adjust star count and size
  • Adjust blending modes and transparency calculations in the shaders

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages