Giter Club home page Giter Club logo

bitmapterrain_a's Introduction

BitmapTerrain

C++/OpenGL terrain generator from a grayscale image.

Samples

image_3

image_4

image_1

image_2

image_5

image_6

Setup

Clone repository along with submodules (-j4 flag is an optional speed up):

git clone --recurse-submodules -j4 https://github.com/matorsoni/BitmapTerrain.git

Build and run the project:

cd BitmapTerrain/
mkdir build
cd build
cmake ..
make -j4
./terrain

Note: GLFW may ask for additional dependencies that are not installed in your system. Installing them and rebuilding this project should work fine.

Running the application

Execution modes:

(1) ./terrain

(2) ./terrain <path-to-grayscale-image.png>

(3) ./terrain <path-to-grayscale-image.png> <path-to-rgb-texture.jpeg>

Running (1) will create the default image terrain (BitmapTerrain/assets/bitmap.png) renderer with the default texture (BitmapTerrain/assets/wood.jpeg).

Running (2) will create a terrain based on input image, renderer with the default texture.

Running (3) will create a terrain based on input image, renderer with the input texture.

Note: While textures can be of any image type, terrain generation only works with true grayscale images. To convert any image to this format, I recommend running the following ImageMagick command:

convert <input_image> -set colorspace Gray -separate -average <output_image.png>

Inputs

  • Move camera with WASD + mouse movement.
  • Mouse scroll to increase and decrease terrain height.
  • Press F to render on wireframe mode (On/Off).
  • Press T to apply texture (On/Off).
  • ESC to close application.

bitmapterrain_a's People

Contributors

matorsoni avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.