Away3D Liquid Ball

Get Adobe Flash player

As part of one of my last projects I needed to create this interactive oil blob (as seen here, 58 seconds in). Thought I’d do a quick post showing it off and sharing the source for anyone who is interested.

The environment map is of Manly Beach (Sydney) and was photographed by myself, so feel free to use without restriction.

source can be downloaded from here.

7 Comments

  1. Hi,
    Amazing work Pete.
    The souce zip contains the published file, would you be willing to share the code ?

  2. Oh, my bad.. Thanks for pointing that out, it looks like I mistakenly only zipped the bin folder. The download has been updated with the source.

  3. Thank you Pete.

  4. -|m| aWesome

  5. Hi Pete Shand,

    very nice work! There is a Question concerning the backside/backface of the ball:

    Why is the backside not rendered to by liquide ? For Example you change the container.rotation you can see that the backside is not liquide. Is it very complicated to add a Script ?
    thank you

    Andi

  6. Hey there. If i remember correctly i did that for performance reasons… moving less vertex required less calcs and seeing as in my case the camera was always looking at the front there was no need to animate the back. It should be pretty easy to make the back animate as well. But yeah if i was to do it again I’d do it on the GPU with AGAL… that way there’d be no performance issues… even if you bumped the number of vertex right up.

  7. Ok, I did now comment out the following for making the backside active:

    /*
    if (vec.z >= 0) {
    spring.active = true;
    }
    else {spring.active = false;

    spring.currentVertex.x = vec.x;
    spring.currentVertex.y = vec.y;
    spring.currentVertex.z = vec.z;
    }
    */
    spring.update();
    vertexSprings.push(spring);
    }

    buildMesh();

    But now there is a gap between backface and frontside if the vertexs are moving.
    Do you have a suggestion ?

Submit a Comment

Your email address will not be published. Required fields are marked *