예제 #1
0
        public void Draw(Surface screen)
        {
            double Pi2 = 2 * Math.PI;

            for (double theta = 0, dtheta = 0.0001f; theta < Pi2; theta += dtheta)
            {
                float x = Center.X + Radius * (float)Math.Cos(theta),
                      y = Center.Y + Radius * (float)Math.Sin(theta);
                int tx  = (int)Math.Round((x + 1) / 2 * screen.width);
                int ty  = (int)Math.Round((-y + 1) / 2 * screen.height);

                if (x * x + y * y <= 1)
                {
                    screen.pixels[tx + ty * screen.width] = MyApplication.MixColor(new Vector3(255, 0, 0));
                }
            }
        }