Giter Club home page Giter Club logo

sierpinski-carpet-opengl's Introduction

Sierpinski Carpet in OpenGL

Sierpinski Carpet generation using OpenGL and GLUT library. Written in c++.

Images

Carpet generated by 6 iterations and width of 728 pixels:

Carpet by 6 iterations and width of 728 pixels

Generated by executing:

./bin/main --iterations 6 --width 728

Carpet with random color and deformations:

Carpet with random color and deformations set to 0.3

Generated by executing:

./bin/main --iterations 4 --deformation 0.3 --color

Compiling:

To compile the source code execute:

make

or:

g++ src/main.cpp -lGL -lglut -o bin/main

Usage:

To run the program execute:

./bin/main

Available parameters:

  • --size <size_in_px> sets the carpet width and height. The size_in_px value must be a power of 3 (default value: 728),
  • --iterations <num_of_iterations> sets the number of iterations ("the depth of the recursion tree") (default value: 6),
  • --color sets the color of inner cubes to random values,
  • --deformation <deformation_amount> randomly deforms the carpet. The deformation_amount must be a floating point number between 0.0 and 1.0. 0.0 means no deformation. 1.0 means that deformation can achieve a maximum value of one inner square (default value: 0.0)
  • --help prints help text.

sierpinski-carpet-opengl's People

Contributors

piotrdurniat avatar

Stargazers

 avatar

Watchers

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