Tuesday, February 9, 2010

Nature Of Code: Flower Modeling Mk. 3

The image above is a screen grab of the third revision of my flower-based physics model, last mentioned here.  Since then, the model has gone through a number of iterations.  The first modified the graphics to be slightly more refined, and more successfully integrated a wind force, as well as a flower "wobble".  The initial issues I had with the wind being too uniform were resolved by putting a limit on the force vector, as opposed to the resulting velocity vector.  The velocity limit had been causing all of the flowers to share velocity and direction.  I intriduced the "wobble" in an effort to give each flower its own movement, in spite of the shared wind vectors.

This revision, the third, takes the second revision and adds the concept of thermals.  The thermals can be seen in the regions defined by white lines above.  These thermals provide a third, largely upward, force that is defined by the developer.  When blooms cross them, the addition of the thermals can result in spontaneous upward movement, ostensibly due to air current resulting in difference from temperature.  From here, I think the next logical step is transferring the wind force from a single shared force screen-wide into an array of wind vectors, varying based on screen location.

Code:  Flower Modeling Mk. 3

No comments:

Post a Comment