Code Monkey home page Code Monkey logo

gl-terrain-demo's Introduction

This is a simple OpenGL terrain demo, intended as a programming exercise
and nothing else. The demo showcases water rendering, shadow mapping,
3D model loading and forward rendering Phong-based lighting.

Build requirements
------------------------------------

You need the following dependencies installed on your system:

- Glib
- GLFW3
- SDL Image (1.2)
- glm
- OpenGL

In Ubuntu, these are provided by the following packages:

- Glib:             libglib2.0-dev
- GLFW3:            libglfw3-dev
- SDL Image (1.2):  libsdl-image1.2-dev
- glm:              libglm-dev
- OpenGL:           Mesa or proprietary driver packages

Bulding and excuting the demo
-----------------------------------

$ ./autogen.sh
$ make
$ cd src/
$ ./demo

It is important to execute the last command from inside the src/ directory!

Once the demo is running you can use the keyboard to move and rotate the
camera (up, down, left, right, pageup and pagedown).

Configuration
-----------------------------------

There are many configurable aspects in the demo, most of these are contained
inside the main-constants.h file, feel free to edit this to experiment with
the demo.

You can also tweak the number of objects of each class in main.cpp (look for
the object_count[] array at the beginning of the file).

Objects are randomly positioned on the map. If you want to execute the same
exact scene multiple times you can edit main.cpp and pass a constant argument
to srandom().

Enjoy!

gl-terrain-demo's People

Contributors

itoral avatar anholt avatar inigomartinez 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.