Skip to content

BSoDium/voxelife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧬 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 manual. Once vcpkg is installed and added to your path, clone this repository and run the following commands:

cd voxelife
vcpkg install

If you encounter any errors while running the install command, please refer to the vcpkg issues, as it is highly likely that someone else has encountered it before.

🔥 Top related issues:

microsoft/vcpkg#26848

Once 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.

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:

./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:

{
    "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

Screenshot 2 Screenshot 3