GithubHelp home page GithubHelp logo

andreipitis / fluiddynamicsmetal Goto Github PK

View Code? Open in Web Editor NEW
166.0 5.0 22.0 8.91 MB

A fluid dynamics implementation using Metal for iOS and OSX.

License: MIT License

Swift 79.12% Metal 20.88%
fluid-dynamics fluid-simulation ios osx metal swift

fluiddynamicsmetal's Introduction

FluidDynamicsMetal

A fluid dynamics implementation using Metal for iOS and OSX.

fluiddynamics

Usage

There are two targets in this project, simply select the scheme of the one you wish to see and build it:

1. FluidDynamicsMetaliOS

Interaction for the iOS version is done through touch events, simply touch the screen and swipe in order to interact with the fluid.

  • A single finger double tap pauses or resumes the simulation.

  • A two finger double tap changes the surface that is drawn. By default, the density field is displayed, but you can also see the pressure, velocity or the surface used for computing the vorticity (smoke-like swirlies).

2. FluidDynamicsMetalOSX

Interacting with the OSX version is similar, you use the mouse to interact with the fluid, the space bar to pause the simulation and the S key to change the surface.

Changing parameters

Right now there is no settings view to select and configure the various parameters of the simulation, so if you wish to change some of the values and see how it affects the result, you're going to have to change the code for the shaders.

Understanding the simulation

If you wish to understand how all of this works, take a look here or here. These are some of the sources I used when creating the simulation.

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.