Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

    • CommentAuthorTripleH
    • CommentTimeApr 9th 2009
     
    Hi there,

    I'm working on a project to create an animation showing how a combined sewer works. I've used FLiNT to make the rain effect, but I haven't had any luck with what to do for a fluid flowing through pipes.

    Basically, what I need to do is show a stream of sewage flowing through a pipe system, then have rain water enter and join the flow (hopefully I'd be able to show the two streams mixing), then the whole thing increasing volume the longer it rains. I've seen that a few people here have experimented using blur filters and bitmap renderers for the fluid, but I don't know if that's the most effective way.

    I guess my main question is how can I make the flow follow the pipe system?
  1.  
    It looks like you want the same thing I do: http://flintparticles.org/forum/comments.php?DiscussionID=194

    Not sure it's possible at this stage in Flint.
    • CommentAuthorRichard
    • CommentTimeApr 10th 2009
     
    • CommentAuthorTripleH
    • CommentTimeApr 13th 2009
     
    I've managed to get to a decent place with this. I used TurnTowardPoint and MatchVelocity to turn the particles and keep them in a stream. Combined with a lower Steady rate, larger particles, and a higher blur filter setting, it runs much much faster than before.

    So the first part is checked off. Now I need to make the some of the flows increase in volume over time, as well as getting the rain to collect on a roadway/rooftop. Suggestions?
    • CommentAuthorTripleH
    • CommentTimeApr 14th 2009
     
    I hate to keep commenting on my own thread, but I thought I'd share that I found a way to simulate accumulation. I used LinearDrag in a ZonedAction to slow down and stop the particles, then an Accelerate command to cause them to flow into a drain pipe. The only drawback is that the drag only causes the particles to stop in a narrow band ( around 25 pixels ), but the acceleration spreads them out so it looks fine.

    I'm still stuck on how to make the streams increase in volume over time. I've been looking at it, and I think using an addActivity to the emitters can do it, but I'm not sure how to change the desired properties ( emitter size, Steady count, etc. ) with it.
    • CommentAuthorRichard
    • CommentTimeApr 16th 2009
     
    You can directly adjust the rate property of the Steady counter, either from an activity or some other code, or alternatively make a custom counter that adjusts its own rate over time.
    • CommentAuthorTripleH
    • CommentTimeApr 20th 2009
     
    Ok, so now I have pretty much gotten the entire thing to work. The only problem is it slows down after about 10 seconds. I have made sure that all particles hit their respective death zones, as well as have them all age just in case. The biggest problem is that the particles that "collect" on the roadway and roof stop moving after a while and just collect on a line. I'm guessing it's because I have to use a really high acceleration to overcome the really high drag needed to stop the particles. Is there anyway of optimizing things without removing particles from the screen?
    • CommentAuthorTripleH
    • CommentTimeJun 8th 2009
     
    An update:

    I switched it to a BitmapRenderer. All the emitters are down to 2-4 particles per second, and the BlurFilter on the renderer produces a much nicer fluid flow look than the DisplayObjectRenderer. I'll post the finished product in the Show and Tell forum when it goes live ( hopefully soon ).
  2.  
    Can't wait to see it!
    • CommentAuthorspganne
    • CommentTimeNov 5th 2009
     
    TripleH....did you ever get your project to work? I have a project where I'm trying to create a stream of fluid going through a pipe which has twists and turns in it. I will want to be able to increase the flow rate dynamically (not just new particles emitted, but those currently in the stream should be updated to have the new velocity). I will also have places in the pipe that will become constricted (again this will happen dynamically) and I will want the particles to move into the constriction area (not just die/disappear) and squeeze through that part of the pipe at an accelerated rate. I can't seem to get even the most basic stuff to work (like MoveTowardsPoint). Starting to get a bit frustrated. Any/all help you are willing to provide will be greatly appreciated!
    • CommentAuthorspganne
    • CommentTimeNov 5th 2009
     
    In case others are interested, I learned the way to adjust the velocity of things already in the stream is to iterate through the array of particles stored in the Emitter's .particles property and set the velX and velY properties of each particle. I still could use help with how to get my particles to go around bends in the pipe in a realistic way and also how to make them squeeze through a constriction with accelerated motion. Looking forward to any/all help anyone can provide.
    • CommentAuthorTripleH
    • CommentTimeNov 5th 2009
     
    Hi there,

    My project does work. I haven't posted it yet because the website still isn't live (isn't government efficient?). There's an accelerate action that can accelerate particles within the zone you define, uses the standard zones (rectangle, disc). You can't really use values that are too high, the calculations start getting very large.

    As for going around bends realistically: there's a branch in the SVN called Lines and Collisions that has code for creating BoundingZones out of shapes other than RectangleZones. You can find the updated Flint library here: http://www.visualisations.co.nz/visualise/. Look at posts in May 2009. It really only works well with LineZones though. You pretty much set up the lines how you want the "fluid" to flow and set the bounce to 0 so it follows the line instead of bouncing off of it. Just be careful of intersecting lines, weird stuff happens if they intersect.
    • CommentAuthorspganne
    • CommentTimeNov 8th 2009
     
    TripleH
    Thanks for your response. Sorry to hear your project hasn't been posted yet. Government....less is more IMHO. Hopefully it will be soon for all of us to admire. Thanks for the tips. I've tried to get really methodical to understand all this stuff and built a little tester to play with all the properties of the emitter Position, intialiazer Velocity and then a ZonedAction TargetVelocity action. I'm finding zones very confusing. Perhaps you can clarify a few things for me.
    1) I don't understand the coordinate system/reference points:
    For example, if I have a stage area that is 400x400 and I want a rectangle zone that is positioned at 10,10 (relative to the top left corner of the stage) and is 50 pixels wide and 100 high, do I specify RectangleZone(left,top,right,bottom) as RectangleZone(10,10,50,100) OR RectangleZone(10,10,60,110). i.e. is the 'right' property the width or the x position relative to the stage origin point?
    2) When you specify an initializer Velocity is that relative to the stage origin point or relative to the Position origin point for the emitter?
    3) When I want to do a ZonedAction using the TargetVelocity(targetVelocityX,targetVelocityY,rate), is the targetVelocityX relative to the stage origin point or relative to the ZonedAction's zone origin point or relative to the emitters initialized position?

    Any/all help you can provide would be greatly appreciated.
    • CommentAuthorRichard
    • CommentTimeNov 12th 2009 edited
     
    Hi

    1. RectangleZone(10,10,60,110) - right is the coordinate for the right edge, and bottom is the coordinate for the bottom edge.

    2. It's relative to the particle's initial position. (Really it's not relative to any position because it's a velocity, but when visualizing the zone, picture it relative to the particle's initial position.)

    3. It's a velocity. Velocity is speed and direction, which is not dependent or related to any location. It is how fast the particle is moving and what direction it is moving.