Example #1
0
 public Circle(int count, double ballRadius, double circleRadius)
 {
     for (var k = 0; k < count; ++k)
     {
         var angle = (double)k / count * 2 * Math.PI;
         var x = Math.Cos(angle) * circleRadius;
         var y = Math.Sin(angle) * circleRadius;
         var z = 0;
         int r, g, b;
         HslToRgb(angle / 2.0 / Math.PI, 1.0, 0.5, out r, out g, out b);
         Balls.Add(new Ball(new Vector3D(x, y, z), ballRadius, new Color((byte)r, (byte)g, (byte)b)));
     }
 }
Example #2
0
 public Lissajous(int count, double ballRadius, double size)
 {
     a  = 2;
     b  = 3;
     c  = 5;
     d1 = 0;
     d2 = 0;
     d3 = 0;
     for (var i = 0; i < count; ++i)
     {
         var angle = i * Math.PI * 2 / count;
         int r, g, bl;
         HslToRgb(angle / 2.0 / Math.PI, 1.0, 0.5, out r, out g, out bl);
         Balls.Add(new Ball(size * Point(angle), ballRadius, new Color((byte)r, (byte)g, (byte)bl)));
     }
 }
Example #3
0
            public Cube(int side, double scale)
            {
                var radius = scale / 2.0 / side;

                for (var i = 0; i < side; ++i)
                {
                    for (var j = 0; j < side; ++j)
                    {
                        for (var k = 0; k < side; ++k)
                        {
                            var x = scale * i / side - scale / 2 + radius;
                            var y = scale * j / side - scale / 2 + radius;
                            var z = scale * k / side - scale / 2 + radius;
                            Balls.Add(new Ball(new Vector3D(x, y, z), radius, new Color(255, 0, 0)));
                        }
                    }
                }
            }