https://github.com/bsodium/voxelife
A C++ game of life implementation in 3D space
https://github.com/bsodium/voxelife
3d cpp game-of-life opengl simulation
Last synced: 7 months ago
JSON representation
A C++ game of life implementation in 3D space
- Host: GitHub
- URL: https://github.com/bsodium/voxelife
- Owner: BSoDium
- License: mit
- Created: 2022-10-18T21:56:53.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-06T19:29:11.000Z (almost 3 years ago)
- Last Synced: 2024-05-01T16:38:01.489Z (over 1 year ago)
- Topics: 3d, cpp, game-of-life, opengl, simulation
- Language: C++
- Homepage:
- Size: 11.6 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🧬 Three-dimensional Game of life simulation
This is a proof of concept for a three-dimensional game of life simulation. It is written in C++ and uses OpenGL for rendering.
## Installation
### Generic setup
This repository uses vcpkg for dependency management. You may use third party package managers, such as apt, to install the dependencies, but the following instructions assume you do not. All dependencies are listed in the `vcpkg.json` file.
Start by installing vcpkg globally on your system. You can find instructions for this on the vcpkg [getting started](https://vcpkg.io/en/getting-started.html) manual. Once vcpkg is installed and added to your path, clone this repository and run the following commands:
```bash
cd voxelife
vcpkg install
```If you encounter any errors while running the install command, please refer to the [vcpkg issues](https://github.com/microsoft/vcpkg/issues), as it is highly likely that someone else has encountered it before.
:fire: Top related issues:
> https://github.com/microsoft/vcpkg/issues/26848Once the dependencies are installed, you can build the project using cmake. The following commands will build the project and place the executable in the `build` directory.
```bash
mkdir build
cmake -DCMAKE_TOOLCHAIN_FILE:STRING={vcpkg root}/scripts/buildsystems/vcpkg.cmake .
cd build
make
```
with `{vcpkg root}` being the path to the vcpkg root directory (e.g. `~/vcpkg`).Run the program:
```bash
./voxelife
```### Visual Studio Code
Open the VS Code workspace, which can be found at the root of the repository. Proceed then to install the recommended extensions, and configure the cmake tools extension to use the vcpkg toolchain file, by adding the following to your `settings.json` file:
```json
{
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "{vcpkg root}/scripts/buildsystems/vcpkg.cmake"
}
}
```
You should now be able to build and run the project from within VS Code, by opening the Run and Debug panel and selecting the `(gdb) Launch` configuration.## Usage
Controls:
- Arrow keys to rotate the camera around the origin
- W and S to move the camera closer and further away from the origin
- Space to play/pause the simulation
- R to reset and randomize the current cell state## Screenshots

