GithubHelp home page GithubHelp logo

json1109 / infty Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jdihlmann/infty

0.0 0.0 0.0 5.37 MB

🧱🌍 wave form collapse demo with react three fiber and web assembly

Home Page: https://inftyworld.vercel.app

Shell 0.15% JavaScript 73.56% Python 4.54% TypeScript 21.04% CSS 0.71%

infty's Introduction

Infinite World Generation

Demo of the wave form collapse (WFC) algorithm with react three fiber and web assembly (WASM) Tweet

Demo_WFC_Application.mov

The WFC algorithm is part of the family of procedural algorithms and allows to construct object grids that follow human designed neighbouring rules. It was first introduced by Maxim Gumin and apated for 3D by many others such as in the StΓ₯lberg experiments or generative cities. This project provides a baseline of the WFC algorithm in a flexible but still a very performant manner. We present a pipeline containing three parts the fast flexible WFC WASM implementation, a model and adjancency exporter and a demo that showcases the results and interacts with the WFC WASM. In this repository one will find the adjancency exporter, the compiled WASM and the demo. The demo can be tested at https://inftyworld.vercel.app/.

Features

The WFC WASM version features a 32x16x32 3D solver, with a run and a run step mode. Voxels can be preset to set the floor or pad the walls. Additionaly a sampling rate of objects can be set to force certain models over others, this is usefull to create for example more sparse results. The solver features a backtracking step, to avoid getting stuck in unsolvable situations. For the exporter part of the pipeline we used blender to model the objects. One is able to export the models and adjacency examples with the provided python scripts. The results of the compination of the exporter and the WASM can be viewed in the demo, which also has a generate and a step mode. Models can be exported and smapling rate can be changed.

Contents

In the following you find a short description of the most important files that are in connection with WFC. Files that are not named here are either config files or supporting structure to render and display the results.

.
β”œβ”€β”€ public
β”‚   β”œβ”€β”€ ... .glb                     # All models glb files
β”‚   β”œβ”€β”€ wfc.wasm                     # Web assembly wave form collapse
β”‚   └── constraint.json              # Adjacency constraints
β”‚
β”œβ”€β”€ src                             
β”‚   β”œβ”€β”€ components                 
β”‚   β”‚   β”œβ”€β”€ generator                # Generator files loading and using WFC
β”‚   β”‚   └── displayer                # Displayer of generated WFC structures
β”‚   β”œβ”€β”€ models                       # All models tsx files
β”‚   └── wfc                          # Emscripten WFC javascript module
β”‚
β”œβ”€β”€ stores                             
β”‚   └── generationStore.tsx          # Config for WFC such as size and samples
β”‚
└── blender                             
    β”œβ”€β”€ infty.blend                  # Blender file with objects and scripts
    β”œβ”€β”€ nameExporter.py              # Name exporter to copy paste in javascript
    β”œβ”€β”€ constraintExporter.py        # Constraint exporter for adjacency
    β”œβ”€β”€ objectExporter.py            # Object exportet for models
    └── gltfjsxify.sh                # TSX file generator from glb files

Misc

This project was part of the Computer Graphics internship by the university of TΓΌbingen. Big thanks to Martin Donald for his amazing tutorial as well as Oskar StΓ₯lberg and Marian Kleineberg for their inspiration.

infty's People

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.