buoyancy simulation in GS? any advice?

part12studiospart12studios Member Posts: 620
edited January 2012 in Working with GS (Mac)
Hi everyone,

So i have this idea and it would require objects to float on water. Has anyone tried this or have some ideas on how i could have objects float up and down... doesn't have to be super realistic.. but clearly the idea that objects hover at the water line.. kinda like the first few secs of this video.. although not so jumpy..

Thanks!
Caleb

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    edited January 2012
    Check out penguin glide. There's a free version. I can help you out if you like how the bouy bounces in the water. I'm headed to bed now but if that's what your looking for let me know. I'll check this thread in the morning.
  • CloudsClouds Member Posts: 1,599
    edited January 2012
    Here, I've done you a quick floating thing . . . just wobbling around some sine/cosine values, works pretty well . .

    http://www.mediafire.com/?ytwbybstzybuug4

    Just throw in a few splashes and a nice watery sound . . .
  • CloudsClouds Member Posts: 1,599
    edited January 2012
    One important point on floating bouncing wobbly things . . . if your image goes right up to the edge then GS will struggle with the anti-aliasing (specifically when rotating).
    What I have discovered is that if you put a thin line of transparency around the edges of (in this example below) a square then GS will give you a much much much (much) better edge quality !

    Check it out, the square on the left is simply a block of colour, the square on the right is the same file that I have taken into Photoshop and given it a 2 pixel transparent boarder.

    http://www.mediafire.com/?2x5jb3mzg46d2wu

    You can see how much worse the anti-aliasing is on the actor without the transparent edge.
  • part12studiospart12studios Member Posts: 620
    Thanks everyone these are all very encouraging!

    Tynan, your one looks the most promising for what i'm doing. the one issue i did notice is that what i would want is to move your squares down underwater and have them float up (like if they were ice cubes). When i move them down to the bottom or in the air they snap right back to the ranges.. one simple way i need to try would be to make a rule when the object gets to a certain range THEN apply the constraints.. but maybe there is a more elegant way to handle it?

    I really need to understand constraints better... does anyone know of a tutorial that might really specialize in explaining how to really use constraints? none of the games i have made use them at all.. because they never seem to do what i think they should.. or how to use them in certain situations.
  • CloudsClouds Member Posts: 1,599
    edited January 2012
    @ part12studios

    the one issue i did notice is that what i would want is to move your squares down underwater and have them float up (like if they were ice cubes).

    When the object is touched > constrain it's Y (vertical) position to the mouse (or finger) Y position > when you release your mouse/finger (the 'otherwise' part of the rule) then interpolate the object back to it's original position . . . .

    Here you go, drag the middle guy down underwater . . . then release him to let him 'ice-cube' his way home:

    Link >>>> http://www.mediafire.com/?y5296n6n7t83s73

    I really need to understand constraints better

    I am just a beginner like you so take this with a pinch of salt, basically a constraint simply forces one value to follow another. It's probably more simple than you think.


  • part12studiospart12studios Member Posts: 620
    that's awesome. very helpful :)
Sign In or Register to comment.