rlguy/GridFluidSim3D

How can i define a scene?

vitos1k opened this issue · 3 comments

Hello! Sorry if this is inapropriate place to ask
i've built your code with mingw64 on windows7
Application starts fine, and it's baking .ply files in bake folder, but what is it baking?
How can i create my own scene and bake it?

rlguy commented

Hello vitos1k,

Sorry that I do not have any detailed instructions on how to use the fluid simulator in the readme.

This fluid simulation program generates a triangle mesh for each frame and stores this data in the .ply file format. The fluid simulation is configured in the file src/main.cpp and the default simulation drops a ball of fluid in the center of the fluid domain.

To render the simulation into an animation, you will need to import the series of .ply meshes into a rendering program where you can set up the scene/lighting/camera. I use the free and open source Blender software to render the fluid simulations that I run.

If you are not familiar with Blender, you can try out this .blend file that will import the .ply meshes and render the default simulation. I have highlighted the important areas for configuring the render in this screen shot:

basic_render

To render the animation your will need to

  1. Change the WATER_FILEPATH_DIRECTORY variable to the filepath of your bakefiles folder
  2. Set the resolution and frame range of the animation
  3. Set the output destination
  4. Click the 'Run Script' button
  5. Click the 'Animate' button

I hope this information helps! I should have detailed instructions and documentation on how to use the simulator within the next few weeks.

Best Regards,
Ryan

In case you only need to import a single frame, you can also use File -> Import -> Stanford (.PLY)

If you want something else than a drop of water, you will need to edit main.cpp in the src folder as stated above. The available functions can be looked up in fluidsimulation.h.

rlguy: fluidsimulation.cpp/h is not really documented. Do you have some example configurations?

rlguy commented

I have added some documentation to the public methods in src/fluidsimulation.h and some usage examples in the src/examples/ directory.