Coder Social home page Coder Social logo

3dfluid's Introduction

3D Fluid

A 3D Real Time Fluid Solver based on Jos Stam's 2D fluid solver (stable Navier-Stokes solver).

Video Demonstration

Try it in your browser:

http://blainmaguire.com/projects/3dfluid/fluid.html

Reference: Jos Stam, "Real-Time Fluid Dynamics for Games". Proceedings of the Game Developer Conference, March 2003.

http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf

Controls:

  • 'X' key - add source at center
  • 'W' key - apply force x-axis
  • 'D' key - apply force y-axis
  • 'S' key - apply force z-axis
  • 'C' key - clear simulation
  • 'V' key - show/hide velocities
  • 'A' Key - show/hide the XYZ axis
  • 'H' key - show/hide this help message
  • Left click - pan from location
  • Right click - rotate cube
  • ESC - quit

Potential Issues

Nothing's Happening

Be sure to press X a few times to add fluid. Then tap W, S, or D repeatedly. It could also be it's running way too slow on your computer.

It runs really slow

It takes exponentially more time to render larger the grid size gets. Try lowering the value of SIZE at the beginning of main.c. Increasing SIZE does make it look better but at the cost of performance.

Compiling

The code is all in c using GLUT, so it should be quite portable. I've included a simple makefile which I used.

The only thing I think might be problematic is I'm using GLUT to render bitmap characters for the help message via glutBitmapCharacter. This shouldn't really be a problem for newer implementations (openglut/freeglut).

If you are having other issues let me know.

3dfluid's People

Contributors

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