How to draw clouds?

I need an algorithm to draw clouds or cloud shapes. Obviously, I would not want them all to be alike. What should I use to create an appropriate series of X, Y coordinates for drawing clouds?
I am going to implement this in either SVG or Canvas

+5
source share
7 answers

You can use the SVG feTurbulence filter primitive to generate Perlin noise, which you can use to create cloud textures.

Some help and examples:

Inkscape svg, . , . " " feTurbulence , , . Inkscape , "p > ..." .

+4

, . Perlin, .

+11

, .

- !

, .

+3

, , , , , , . , , . .

0

this code creates a bunch of circles in an array of colors, maybe this will help you with the clouds

    for (var i = 0; i < 12; i++)
    {
      for (var j = 0; j < 12; j++)
      {
        var ctx = document.getElementById('c1').getContext('2d');
        ctx.strokeStyle = 'rgb(0,' + Math.floor(255 - 42.5 * i) + ',' + 
        Math.floor(255 - 42.5 * j) + ')';
        ctx.beginPath();
        ctx.arc(40 + j * 25, 40 + i * 25, 10, 0, Math.PI * 2, true);
        ctx.stroke();
       }
     }
0
source

Create a cluster of bubbles (circles or horizontal ellipses) and take a union of shapes for each cloud.

0
source

All Articles