Thursday, April 12, 2012
Fixed a few bugs
After a couple days of debugging, yesterday we had a mini breakthrough and realized that we had been advecting velocities/projecting with the wrong faces! And our bounds checking was a bit off as well. The particles now fall to the ground ( but the velocities explode once they get there...). Progress!
Monday, April 9, 2012
What I've Been Doing For Two Days
I'm no good at blogging, so here's a quick breakdown:
My hopes are that we have a VERY basic liquid sim working in at LEAST two dimensions by alpha time. As we've done more reading and actually started programming, it's become clear to both of us (I think) that what we are aiming to do won't exactly be doable the way we meant to achieve it. There are certain things we'll likely be leaving out of our initial intended implementation (level sets come to mind), while adding more things for realistic liquid simulation (viscosity, surface tension, etc). There's obviously still a lot we can do - interaction with solids, continuous water sources, free bodies of water particles, etc. - but for now I think we're going to focus on getting this smoke sim simulating water proper.
- Implemented a new graphical display. I started out by coloring cells in blue that contained liquid particles, but that display method got buggy fast (and was admittedly pretty ugly). I ended up switching out the cell method with just drawing all our particles as points (in semi-transparent blue). I experimented with rendering points as spheres, but it had the same relative effect and (for some reason) it was hard for me to get the spheres to show up in their proper positions (I left that code commented out in case we ever choose to switch back to a particle implementation). I find it easier to debug and figure out what's going wrong when there's some kind of visual involved, so that's been helpful so far.
- I rewrote advect velocities and projection so that they no longer compute velocities for any cells that don't contain particles. For a while this yielded decent (though flawed) results. Once I finished, we had our three sample particles drawing at the correct point in space before slowly drifting apart from each other in the x-direction - behavior that we actually expected since we haven't yet implemented velocity extrapolation (as we found in the Batty notes)
- I implemented velocity extrapolation, but realized after it failed that I calculated per cell instead of per face, meaning the velocities of each point were off by about one position in each direction and, in some cases, were not even being calculated. Unfortunately I didn't have time to debug this before handing it back to Christine, since I have more work I need to get done soon...
- I debugged a lot of our existing code. There was a lot of debugging to do.
![]() |
| Liquid cells rendered as Tetris blocks |
![]() |
| Liquid particles rendered as particles. |
Sunday, April 8, 2012
First Steps
Sooo we decided we needed to change how we were doing things a little bit! After more reading (we read through Dr. Christopher Batty's notes found at http://www.cs.columbia.edu/%7Ebatty/teaching/general/Fluids2.pdf and looked over his base code for a liquid sim ) we realized we needed to implement marker particles before we did anything else (like level sets...). So this weekend I added a vector<vec3> that holds the locations of the particles that will mark the location of the liquid and functionality that advects their positions according to the velocity field of the grid. I also added two vectors of booleans for tagging that hold whether a given cell is empty/not empty and solid/not solid. When the positions of the particles are advected, the cell that the given particle is in is tagged as "not empty". I've also added a function for initializing the particles' positions and for right now we are just manually placing them. For the future I'm concerned that the bounds checking that I'm doing when we advect the particles is too simple (it's just check their locations against the dimensions of the grid*cell size) because it's not generalizable to other shaped containers. I hit some strange value initialization issues last night that I think might be a scoping mistake, but I handed it off to Jason (who is traveling back home as we speak)!
Happy Holidays! Animation played a major role in my religious holiday education so here's some tidbits for you:
Happy Holidays! Animation played a major role in my religious holiday education so here's some tidbits for you:
Friday, March 30, 2012
The Adventure Begins!
Final Project time for Physics based animation! We're extending our smoke simulation from Assignment 2 to do a water simulation with a semi-langrangian approach, because we think water's pretty cool. Here's our rough timeline:
- This Weekend: Get familiar with the base code (Jason's) and strip it of the smoke specific-parts
- By Saturday April 7th: Have our individual parts completed (Jason is doing velocity extrapolation and surface tension, I (Christine) am doing level sets).
- Monday April 9th: Combine our parts to make a working 2D water simulation
- Friday April 13th : Mid-Review Day. We are going to do our best to have our sim in 3D by this day, but it may take the weekend after.
- Monday April 16th: It will definitely be in 3D by this day!
- May 7th: Final Project due!
We will spend the weeks between April 16th and May 7th making it awesome and more interesting, but the breakdown of those goals are TBD at a later time, depending on where the project takes us. Right now we are considering implementing viscosity for simulating thicker fluids and also creating different types of sources for the liquids (pouring water , dropping water volumes, etc.)
Here are some videos that have inspired us (we could watch these things for hours!) :
Here we go!
Subscribe to:
Posts (Atom)

