Example #1
0
        public Renderer(VariableSet variables, Drawable drawable) : base(variables)
        {
            _random       = new Random((int)GetValue <UInt32>("seed"));
            Swirly.Random = _random;

            _width  = drawable.Width;
            _height = drawable.Height;

            for (int i = 0; i < GetValue <int>("points"); i++)
            {
                _swirlies.Add(Swirly.CreateRandom());
            }
        }
Example #2
0
        static public Swirly CreateRandom()
        {
            Swirly swirly = new Swirly();

            swirly._x = random.NextDouble();
            swirly._y = random.NextDouble();

            swirly.r = drand48s();
            swirly.g = drand48s();
            swirly.b = drand48s();

            swirly.C = random.NextDouble();
            swirly.S = random.NextDouble();

            swirly.Pc = rand_phase_shift();
            swirly.Ac = rand_angle_multiplier(1, 0);
            swirly.Dc = rand_linear_phase_shift(1, 0);
            swirly.Cc = rand_secondary_coefficient(1, 0);
            swirly.Sc = rand_secondary_coefficient(1, 0);
            swirly.Kc = rand_mixed_coefficient(1, 0);
            swirly.Zc = rand_mixed_coefficient(1, 0);
            swirly.Ps = rand_phase_shift();
            swirly.As = rand_angle_multiplier(1, 0);
            swirly.Ds = rand_linear_phase_shift(1, 0);
            swirly.Cs = rand_secondary_coefficient(1, 0);
            swirly.Ss = rand_secondary_coefficient(1, 0);
            swirly.Ks = rand_mixed_coefficient(1, 0);
            swirly.Zs = rand_mixed_coefficient(1, 0);

            swirly.Pcc  = rand_phase_shift();
            swirly.Acc  = rand_angle_multiplier(2, 0);
            swirly.Dcc  = rand_linear_phase_shift(2, 0);
            swirly.Ccc  = rand_secondary_coefficient(2, 0);
            swirly.Scc  = rand_secondary_coefficient(2, 0);
            swirly.Kcc  = rand_mixed_coefficient(2, 0);
            swirly.Zcc  = rand_mixed_coefficient(2, 0);
            swirly.Pcs  = rand_phase_shift();
            swirly.Acs  = rand_angle_multiplier(2, 0);
            swirly.Dcs  = rand_linear_phase_shift(2, 0);
            swirly.Ccs  = rand_secondary_coefficient(2, 0);
            swirly.Scs  = rand_secondary_coefficient(2, 0);
            swirly.Kcs  = rand_mixed_coefficient(2, 0);
            swirly.Zcs  = rand_mixed_coefficient(2, 0);
            swirly.Pck  = rand_phase_shift();
            swirly.Ack  = rand_angle_multiplier(1, 1);
            swirly.Dck  = rand_linear_phase_shift(1, 1);
            swirly.Cck  = rand_secondary_coefficient(1, 1);
            swirly.Sck  = rand_secondary_coefficient(1, 1);
            swirly.Kck  = rand_mixed_coefficient(1, 1);
            swirly.Zck  = rand_mixed_coefficient(1, 1);
            swirly.Pcz  = rand_phase_shift();
            swirly.Acz  = rand_angle_multiplier(1, 1);
            swirly.Dcz  = rand_linear_phase_shift(1, 1);
            swirly.Ccz  = rand_secondary_coefficient(1, 1);
            swirly.Scz  = rand_secondary_coefficient(1, 1);
            swirly.Kcz  = rand_mixed_coefficient(1, 1);
            swirly.Zcz  = rand_mixed_coefficient(1, 1);
            swirly.Psc  = rand_phase_shift();
            swirly.Asc  = rand_angle_multiplier(2, 0);
            swirly.Dsc  = rand_linear_phase_shift(2, 0);
            swirly.Csc  = rand_secondary_coefficient(2, 0);
            swirly.Ssc  = rand_secondary_coefficient(2, 0);
            swirly.Ksc  = rand_mixed_coefficient(2, 0);
            swirly.Zsc  = rand_mixed_coefficient(2, 0);
            swirly.Pss  = rand_phase_shift();
            swirly.Ass  = rand_angle_multiplier(2, 0);
            swirly.Dss  = rand_linear_phase_shift(2, 0);
            swirly.Css  = rand_secondary_coefficient(2, 0);
            swirly.Sss  = rand_secondary_coefficient(2, 0);
            swirly.Kss  = rand_mixed_coefficient(2, 0);
            swirly.Zss  = rand_mixed_coefficient(2, 0);
            swirly.Psk  = rand_phase_shift();
            swirly.Ask  = rand_angle_multiplier(1, 1);
            swirly.Dsk  = rand_linear_phase_shift(1, 1);
            swirly.Csk  = rand_secondary_coefficient(1, 1);
            swirly.Ssk  = rand_secondary_coefficient(1, 1);
            swirly.Ksk  = rand_mixed_coefficient(1, 1);
            swirly.Zsk  = rand_mixed_coefficient(1, 1);
            swirly.Psz  = rand_phase_shift();
            swirly.Asz  = rand_angle_multiplier(1, 1);
            swirly.Dsz  = rand_linear_phase_shift(1, 1);
            swirly.Csz  = rand_secondary_coefficient(1, 1);
            swirly.Ssz  = rand_secondary_coefficient(1, 1);
            swirly.Ksz  = rand_mixed_coefficient(1, 1);
            swirly.Zsz  = rand_mixed_coefficient(1, 1);
            swirly.Pccc = rand_phase_shift();
            swirly.Accc = rand_angle_multiplier(3, 0);
            swirly.Dccc = rand_linear_phase_shift(3, 0);
            swirly.Pccs = rand_phase_shift();
            swirly.Accs = rand_angle_multiplier(3, 0);
            swirly.Dccs = rand_linear_phase_shift(3, 0);
            swirly.Pcck = rand_phase_shift();
            swirly.Acck = rand_angle_multiplier(2, 1);
            swirly.Dcck = rand_linear_phase_shift(2, 1);
            swirly.Pccz = rand_phase_shift();
            swirly.Accz = rand_angle_multiplier(2, 1);
            swirly.Dccz = rand_linear_phase_shift(2, 1);
            swirly.Pcsc = rand_phase_shift();
            swirly.Acsc = rand_angle_multiplier(3, 0);
            swirly.Dcsc = rand_linear_phase_shift(3, 0);
            swirly.Pcss = rand_phase_shift();
            swirly.Acss = rand_angle_multiplier(3, 0);
            swirly.Dcss = rand_linear_phase_shift(3, 0);
            swirly.Pcsk = rand_phase_shift();
            swirly.Acsk = rand_angle_multiplier(2, 1);
            swirly.Dcsk = rand_linear_phase_shift(2, 1);
            swirly.Pcsz = rand_phase_shift();
            swirly.Acsz = rand_angle_multiplier(2, 1);
            swirly.Dcsz = rand_linear_phase_shift(2, 1);
            swirly.Pckc = rand_phase_shift();
            swirly.Ackc = rand_angle_multiplier(2, 1);
            swirly.Dckc = rand_linear_phase_shift(2, 1);
            swirly.Pcks = rand_phase_shift();
            swirly.Acks = rand_angle_multiplier(2, 1);
            swirly.Dcks = rand_linear_phase_shift(2, 1);
            swirly.Pckk = rand_phase_shift();
            swirly.Ackk = rand_angle_multiplier(1, 2);
            swirly.Dckk = rand_linear_phase_shift(1, 2);
            swirly.Pckz = rand_phase_shift();
            swirly.Ackz = rand_angle_multiplier(1, 2);
            swirly.Dckz = rand_linear_phase_shift(1, 2);
            swirly.Pczc = rand_phase_shift();
            swirly.Aczc = rand_angle_multiplier(2, 1);
            swirly.Dczc = rand_linear_phase_shift(2, 1);
            swirly.Pczs = rand_phase_shift();
            swirly.Aczs = rand_angle_multiplier(2, 1);
            swirly.Dczs = rand_linear_phase_shift(2, 1);
            swirly.Pczk = rand_phase_shift();
            swirly.Aczk = rand_angle_multiplier(1, 2);
            swirly.Dczk = rand_linear_phase_shift(1, 2);
            swirly.Pczz = rand_phase_shift();
            swirly.Aczz = rand_angle_multiplier(1, 2);
            swirly.Dczz = rand_linear_phase_shift(1, 2);
            swirly.Pscc = rand_phase_shift();
            swirly.Ascc = rand_angle_multiplier(3, 0);
            swirly.Dscc = rand_linear_phase_shift(3, 0);
            swirly.Pscs = rand_phase_shift();
            swirly.Ascs = rand_angle_multiplier(3, 0);
            swirly.Dscs = rand_linear_phase_shift(3, 0);
            swirly.Psck = rand_phase_shift();
            swirly.Asck = rand_angle_multiplier(2, 1);
            swirly.Dsck = rand_linear_phase_shift(2, 1);
            swirly.Pscz = rand_phase_shift();
            swirly.Ascz = rand_angle_multiplier(2, 1);
            swirly.Dscz = rand_linear_phase_shift(2, 1);
            swirly.Pssc = rand_phase_shift();
            swirly.Assc = rand_angle_multiplier(3, 0);
            swirly.Dssc = rand_linear_phase_shift(3, 0);
            swirly.Psss = rand_phase_shift();
            swirly.Asss = rand_angle_multiplier(3, 0);
            swirly.Dsss = rand_linear_phase_shift(3, 0);
            swirly.Pssk = rand_phase_shift();
            swirly.Assk = rand_angle_multiplier(2, 1);
            swirly.Dssk = rand_linear_phase_shift(2, 1);
            swirly.Pssz = rand_phase_shift();
            swirly.Assz = rand_angle_multiplier(2, 1);
            swirly.Dssz = rand_linear_phase_shift(2, 1);
            swirly.Pskc = rand_phase_shift();
            swirly.Askc = rand_angle_multiplier(2, 1);
            swirly.Dskc = rand_linear_phase_shift(2, 1);
            swirly.Psks = rand_phase_shift();
            swirly.Asks = rand_angle_multiplier(2, 1);
            swirly.Dsks = rand_linear_phase_shift(2, 1);
            swirly.Pskk = rand_phase_shift();
            swirly.Askk = rand_angle_multiplier(1, 2);
            swirly.Dskk = rand_linear_phase_shift(1, 2);
            swirly.Pskz = rand_phase_shift();
            swirly.Askz = rand_angle_multiplier(1, 2);
            swirly.Dskz = rand_linear_phase_shift(1, 2);
            swirly.Pszc = rand_phase_shift();
            swirly.Aszc = rand_angle_multiplier(2, 1);
            swirly.Dszc = rand_linear_phase_shift(2, 1);
            swirly.Pszs = rand_phase_shift();
            swirly.Aszs = rand_angle_multiplier(2, 1);
            swirly.Dszs = rand_linear_phase_shift(2, 1);
            swirly.Pszk = rand_phase_shift();
            swirly.Aszk = rand_angle_multiplier(1, 2);
            swirly.Dszk = rand_linear_phase_shift(1, 2);
            swirly.Pszz = rand_phase_shift();
            swirly.Aszz = rand_angle_multiplier(1, 2);
            swirly.Dszz = rand_linear_phase_shift(1, 2);

            return(swirly);
        }
Example #3
0
        public static Swirly CreateRandom()
        {
            Swirly swirly = new Swirly();

              swirly._x = random.NextDouble();
              swirly._y = random.NextDouble();

              swirly.r = drand48s();
              swirly.g = drand48s();
              swirly.b = drand48s();

              swirly.C = random.NextDouble();
              swirly.S = random.NextDouble();

              swirly.Pc = rand_phase_shift();
              swirly.Ac = rand_angle_multiplier(1, 0);
              swirly.Dc = rand_linear_phase_shift(1, 0);
              swirly.Cc = rand_secondary_coefficient(1, 0);
              swirly.Sc = rand_secondary_coefficient(1, 0);
              swirly.Kc = rand_mixed_coefficient(1, 0);
              swirly.Zc = rand_mixed_coefficient(1, 0);
              swirly.Ps = rand_phase_shift();
              swirly.As = rand_angle_multiplier(1, 0);
              swirly.Ds = rand_linear_phase_shift(1, 0);
              swirly.Cs = rand_secondary_coefficient(1, 0);
              swirly.Ss = rand_secondary_coefficient(1, 0);
              swirly.Ks = rand_mixed_coefficient(1, 0);
              swirly.Zs = rand_mixed_coefficient(1, 0);

              swirly.Pcc = rand_phase_shift();
              swirly.Acc = rand_angle_multiplier(2, 0);
              swirly.Dcc = rand_linear_phase_shift(2, 0);
              swirly.Ccc = rand_secondary_coefficient(2, 0);
              swirly.Scc = rand_secondary_coefficient(2, 0);
              swirly.Kcc = rand_mixed_coefficient(2, 0);
              swirly.Zcc = rand_mixed_coefficient(2, 0);
              swirly.Pcs = rand_phase_shift();
              swirly.Acs = rand_angle_multiplier(2, 0);
              swirly.Dcs = rand_linear_phase_shift(2, 0);
              swirly.Ccs = rand_secondary_coefficient(2, 0);
              swirly.Scs = rand_secondary_coefficient(2, 0);
              swirly.Kcs = rand_mixed_coefficient(2, 0);
              swirly.Zcs = rand_mixed_coefficient(2, 0);
              swirly.Pck = rand_phase_shift();
              swirly.Ack = rand_angle_multiplier(1, 1);
              swirly.Dck = rand_linear_phase_shift(1, 1);
              swirly.Cck = rand_secondary_coefficient(1, 1);
              swirly.Sck = rand_secondary_coefficient(1, 1);
              swirly.Kck = rand_mixed_coefficient(1, 1);
              swirly.Zck = rand_mixed_coefficient(1, 1);
              swirly.Pcz = rand_phase_shift();
              swirly.Acz = rand_angle_multiplier(1, 1);
              swirly.Dcz = rand_linear_phase_shift(1, 1);
              swirly.Ccz = rand_secondary_coefficient(1, 1);
              swirly.Scz = rand_secondary_coefficient(1, 1);
              swirly.Kcz = rand_mixed_coefficient(1, 1);
              swirly.Zcz = rand_mixed_coefficient(1, 1);
              swirly.Psc = rand_phase_shift();
              swirly.Asc = rand_angle_multiplier(2, 0);
              swirly.Dsc = rand_linear_phase_shift(2, 0);
              swirly.Csc = rand_secondary_coefficient(2, 0);
              swirly.Ssc = rand_secondary_coefficient(2, 0);
              swirly.Ksc = rand_mixed_coefficient(2, 0);
              swirly.Zsc = rand_mixed_coefficient(2, 0);
              swirly.Pss = rand_phase_shift();
              swirly.Ass = rand_angle_multiplier(2, 0);
              swirly.Dss = rand_linear_phase_shift(2, 0);
              swirly.Css = rand_secondary_coefficient(2, 0);
              swirly.Sss = rand_secondary_coefficient(2, 0);
              swirly.Kss = rand_mixed_coefficient(2, 0);
              swirly.Zss = rand_mixed_coefficient(2, 0);
              swirly.Psk = rand_phase_shift();
              swirly.Ask = rand_angle_multiplier(1, 1);
              swirly.Dsk = rand_linear_phase_shift(1, 1);
              swirly.Csk = rand_secondary_coefficient(1, 1);
              swirly.Ssk = rand_secondary_coefficient(1, 1);
              swirly.Ksk = rand_mixed_coefficient(1, 1);
              swirly.Zsk = rand_mixed_coefficient(1, 1);
              swirly.Psz = rand_phase_shift();
              swirly.Asz = rand_angle_multiplier(1, 1);
              swirly.Dsz = rand_linear_phase_shift(1, 1);
              swirly.Csz = rand_secondary_coefficient(1, 1);
              swirly.Ssz = rand_secondary_coefficient(1, 1);
              swirly.Ksz = rand_mixed_coefficient(1, 1);
              swirly.Zsz = rand_mixed_coefficient(1, 1);
              swirly.Pccc = rand_phase_shift();
              swirly.Accc = rand_angle_multiplier(3, 0);
              swirly.Dccc = rand_linear_phase_shift(3, 0);
              swirly.Pccs = rand_phase_shift();
              swirly.Accs = rand_angle_multiplier(3, 0);
              swirly.Dccs = rand_linear_phase_shift(3, 0);
              swirly.Pcck = rand_phase_shift();
              swirly.Acck = rand_angle_multiplier(2, 1);
              swirly.Dcck = rand_linear_phase_shift(2, 1);
              swirly.Pccz = rand_phase_shift();
              swirly.Accz = rand_angle_multiplier(2, 1);
              swirly.Dccz = rand_linear_phase_shift(2, 1);
              swirly.Pcsc = rand_phase_shift();
              swirly.Acsc = rand_angle_multiplier(3, 0);
              swirly.Dcsc = rand_linear_phase_shift(3, 0);
              swirly.Pcss = rand_phase_shift();
              swirly.Acss = rand_angle_multiplier(3, 0);
              swirly.Dcss = rand_linear_phase_shift(3, 0);
              swirly.Pcsk = rand_phase_shift();
              swirly.Acsk = rand_angle_multiplier(2, 1);
              swirly.Dcsk = rand_linear_phase_shift(2, 1);
              swirly.Pcsz = rand_phase_shift();
              swirly.Acsz = rand_angle_multiplier(2, 1);
              swirly.Dcsz = rand_linear_phase_shift(2, 1);
              swirly.Pckc = rand_phase_shift();
              swirly.Ackc = rand_angle_multiplier(2, 1);
              swirly.Dckc = rand_linear_phase_shift(2, 1);
              swirly.Pcks = rand_phase_shift();
              swirly.Acks = rand_angle_multiplier(2, 1);
              swirly.Dcks = rand_linear_phase_shift(2, 1);
              swirly.Pckk = rand_phase_shift();
              swirly.Ackk = rand_angle_multiplier(1, 2);
              swirly.Dckk = rand_linear_phase_shift(1, 2);
              swirly.Pckz = rand_phase_shift();
              swirly.Ackz = rand_angle_multiplier(1, 2);
              swirly.Dckz = rand_linear_phase_shift(1, 2);
              swirly.Pczc = rand_phase_shift();
              swirly.Aczc = rand_angle_multiplier(2, 1);
              swirly.Dczc = rand_linear_phase_shift(2, 1);
              swirly.Pczs = rand_phase_shift();
              swirly.Aczs = rand_angle_multiplier(2, 1);
              swirly.Dczs = rand_linear_phase_shift(2, 1);
              swirly.Pczk = rand_phase_shift();
              swirly.Aczk = rand_angle_multiplier(1, 2);
              swirly.Dczk = rand_linear_phase_shift(1, 2);
              swirly.Pczz = rand_phase_shift();
              swirly.Aczz = rand_angle_multiplier(1, 2);
              swirly.Dczz = rand_linear_phase_shift(1, 2);
              swirly.Pscc = rand_phase_shift();
              swirly.Ascc = rand_angle_multiplier(3, 0);
              swirly.Dscc = rand_linear_phase_shift(3, 0);
              swirly.Pscs = rand_phase_shift();
              swirly.Ascs = rand_angle_multiplier(3, 0);
              swirly.Dscs = rand_linear_phase_shift(3, 0);
              swirly.Psck = rand_phase_shift();
              swirly.Asck = rand_angle_multiplier(2, 1);
              swirly.Dsck = rand_linear_phase_shift(2, 1);
              swirly.Pscz = rand_phase_shift();
              swirly.Ascz = rand_angle_multiplier(2, 1);
              swirly.Dscz = rand_linear_phase_shift(2, 1);
              swirly.Pssc = rand_phase_shift();
              swirly.Assc = rand_angle_multiplier(3, 0);
              swirly.Dssc = rand_linear_phase_shift(3, 0);
              swirly.Psss = rand_phase_shift();
              swirly.Asss = rand_angle_multiplier(3, 0);
              swirly.Dsss = rand_linear_phase_shift(3, 0);
              swirly.Pssk = rand_phase_shift();
              swirly.Assk = rand_angle_multiplier(2, 1);
              swirly.Dssk = rand_linear_phase_shift(2, 1);
              swirly.Pssz = rand_phase_shift();
              swirly.Assz = rand_angle_multiplier(2, 1);
              swirly.Dssz = rand_linear_phase_shift(2, 1);
              swirly.Pskc = rand_phase_shift();
              swirly.Askc = rand_angle_multiplier(2, 1);
              swirly.Dskc = rand_linear_phase_shift(2, 1);
              swirly.Psks = rand_phase_shift();
              swirly.Asks = rand_angle_multiplier(2, 1);
              swirly.Dsks = rand_linear_phase_shift(2, 1);
              swirly.Pskk = rand_phase_shift();
              swirly.Askk = rand_angle_multiplier(1, 2);
              swirly.Dskk = rand_linear_phase_shift(1, 2);
              swirly.Pskz = rand_phase_shift();
              swirly.Askz = rand_angle_multiplier(1, 2);
              swirly.Dskz = rand_linear_phase_shift(1, 2);
              swirly.Pszc = rand_phase_shift();
              swirly.Aszc = rand_angle_multiplier(2, 1);
              swirly.Dszc = rand_linear_phase_shift(2, 1);
              swirly.Pszs = rand_phase_shift();
              swirly.Aszs = rand_angle_multiplier(2, 1);
              swirly.Dszs = rand_linear_phase_shift(2, 1);
              swirly.Pszk = rand_phase_shift();
              swirly.Aszk = rand_angle_multiplier(1, 2);
              swirly.Dszk = rand_linear_phase_shift(1, 2);
              swirly.Pszz = rand_phase_shift();
              swirly.Aszz = rand_angle_multiplier(1, 2);
              swirly.Dszz = rand_linear_phase_shift(1, 2);

              return swirly;
        }