Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c_simulations

C raylib License: MIT

A collection of C projects focused on 2D and 3D simulations. Each project builds and runs independently.

Projects

A spinning 3D cube rendered in the terminal with ASCII characters. Uses 3D rotation, perspective projection, and a depth buffer to draw the visible faces.

Spinning ASCII cube in the terminal

Build and run on macOS or Linux with a C compiler, starting from the repository root:

cd spinning_cube
cc cube.c -o cube -lm
./cube

Use a terminal that supports ANSI escape sequences with room for 160 columns and 44 rows. Press Ctrl+C to stop.

A 3D particle simulation built with C and raylib. Particles rain into a dotted sphere, collide, and settle under gravity. Supports up to 350 particles, with click spawning and an interactive camera.

Purple particles inside a dotted sphere

Build and run on macOS with Homebrew and a C compiler, starting from the repository root:

brew install raylib pkgconf
cd particle_simulation
cc -O2 -std=c11 -Wall -Wextra main.c $(pkg-config --cflags --libs raylib) -o particle_simulation
./particle_simulation
  • Left-click an empty spot inside the sphere to add a particle.
  • Right-drag to orbit the camera; scroll to zoom.
  • Press Space to pause or resume, R to reset, and Escape to close.

See the project README for physics details and limitations.

License

MIT

About

A collection of C projects focused on 2D and 3D simulations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages