Close Show/hide page

Strange 3D objects, Perlin noise

Thumbnail - Click me

Recently I’ve been thinking on ways of programmatically creating curvy and strange, organic-looking shapes in 3D. And reflecting on the fact that I can think of no particular ‘practical’ application for such an endeavor. And concluding that that’s part of what makes it interesting…

Here’s the high-level recipe:

Start with a cylinder or sphere-shaped mesh, where the vertices are evenly spaced . The vertices of the mesh can be thought of as a matrix or grid, where the left and right edges are curved 360 degrees until they meet.

Take an interesting bitmap with varying light and dark areas, whose height and width match the number of rows and columns in the mesh.

Use brightness (or some other color-derived property) from the pixels of the bitmap as a multiplier value to dictate the distance of the corresponding vertices from the z-axis (center) of the shape.

That’s basically it. In Flash, the built-in BitmapData.perlinNoise method is perfect for generating interesting gradients. The kicker is that the last parameter of the method allows you to change the x & y offset for each ‘octave’ (think semi-transparent layer), allowing for gradual, random-looking changes over time.

So on each update, change the offset of each octave of the perlin noise image and recalculate the vertices accordingly. The behavior and properties of Perlin noise does the rest.

Main class.as | Project.zip (Flex Builder 3)

Licensed under a Creative Commons Attribution 3.0 License.

6 Responses to “Strange 3D objects, Perlin noise”

  1. P. Says:

    Absolutely beautiful.

  2. nurah Says:

    thanks

  3. Bartek Says:

    looks perfect! perlin noise is one of my favourite functions.

  4. Rytis Says:

    Looks great, but attached archive “strangeobj_project.zip” is damaged.

  5. Trevor Says:

    Thanks for sharing your awesome idea.

  6. admin Says:

    Rytis, I double-checked, and the ZIP file is alright.

    Lee

Leave a Reply

Powered by WP Hashcash