Home | Rules and Guide | Sign In/Create Account | Write a Post | Reddit | #LD48 | #ludumdare on irc.afternet.org (Info)

Ludum Dare 29 — April 25th-28th Weekend [9 PM EST] — Theme: ??? (Theme Voting!)
  • Ludum Dare 29 Compo (48 Hour+Solo+Scratch+Src) Begins: in 2 days, 3 hours, 53 minutes, 37 seconds
  • Ludum Dare 29 Jam (72 Hour+Teams OK+Relaxed) Begins: in 2 days, 3 hours, 53 minutes, 38 seconds
  • [ MiniLD 50 | Warmup Weekend | Real World Gatherings | Ludum Deals | Wallpaper ]


    LD 24: Creating procedural critters

    Posted by
    September 12th, 2012 9:00 am

    How do you create theses insect/plant like critters

    Critters

    from these basic shapes?

    Base

    That was the question I posed myself for the Ludum Dare 24 compo. The theme was evolution and I wanted to create some little critters which could change there appearance smoothly.

    The basic shapes you see above can be easily described using polar coordinates.

    Polar coordinates express a 2D curve in the form r(t). For each angle t the function r(t) gives the radius at this angle. Here are the definitions of the simple shapes above:

    • Sphere: r(t) = 1 (a circle has constant radius)
    • Star: r(t) = r0 + (1-r0)*(1-abs((n*t mod 2 pi)/pi-1))^p. This is a bit complicated – I could not find an easier definition. n is the number of star corners and r0 and p are additinal parameters.
    • Rose: r(t) = cos(n*t), where n is the number of rose petals.
    • Cardioid: r(t) = 1 + cos(t + pi). This is a funny mathematical object.

    Now how do we get the complex shapes? Easy: they are formed buy just using a linear combination of the simple shapes.

    For example we use the two simple shape functions r_star(t) and r_cardioid(t) and form the linear combination r(t) = a*r_star(t) + b*r_cardioid(t). Using a and b equal to 0.5 yields the third shape you can see above.

    You can use my critter generator to create your own critters.

    Also, play and rate my compo entry!

    Tags: , , , ,

    Leave a Reply

    You must be logged in to post a comment.


    All posts, images, and comments are owned by their creators.

    [cache: storing page]