Exemple #1
0
        public override void Draw(Graphics g, Camera cam)
        {
            PointF pos  = cam.WorldToScreen(x, y);
            PointF aim  = cam.WorldToScreen((float)(x - Math.Sin(-rot / 180 * Math.PI) * r), (float)(y + Math.Cos(-rot / 180 * Math.PI) * r));
            float  size = cam.Scale(r);

            g.FillEllipse(Brushes.Blue, pos.X - size, pos.Y - size, size * 2, size * 2);

            Pen p = new Pen(Color.Yellow, cam.Scale(10));

            p.EndCap = LineCap.ArrowAnchor;
            g.DrawLine(p, pos.X, pos.Y, aim.X, aim.Y);
        }
 public override void Draw(Graphics g, Camera cam)
 {
     PointF pos = cam.WorldToScreen(x, y);
     float width = cam.Scale(this.width);
     float height = cam.Scale(this.height);
     g.FillRectangle(brush, pos.X - width / 2, pos.Y - height / 2, width, height);
 }
Exemple #3
0
        public override void Draw(Graphics g, Camera cam)
        {
            PointF pos    = cam.WorldToScreen(x, y);
            float  width  = cam.Scale(this.width);
            float  height = cam.Scale(this.height);

            g.FillRectangle(Brushes.LightGreen, pos.X - width / 2, pos.Y - height / 2, width, height);

            float penWidth = cam.Scale(20);

            g.DrawRectangle(new Pen(Color.Green, penWidth), pos.X - width / 2 - penWidth / 2, pos.Y - height / 2 - penWidth / 2, width + penWidth, height + penWidth);
        }
Exemple #4
0
        public override void Draw(Graphics g, Camera cam)
        {
            float x = (float)kalmanX.Value;
            float y = (float)kalmanY.Value;

            if (x > -250 && y > -250)
            {
                PointF pos  = cam.WorldToScreen(x, y);
                float  size = cam.Scale(100);
                g.FillEllipse(Brushes.Cyan, pos.X - size, pos.Y - size, size * 2, size * 2);
                g.DrawEllipse(new Pen(Color.Red, cam.Scale(7)), pos.X - size, pos.Y - size, size * 2, size * 2);
            }
        }
Exemple #5
0
        public override void Draw(Graphics g, Camera cam)
        {
            base.Draw(g, cam);
            return;

            //Iscrtavanje, Stevan treba da se poigra sa ovim :)
            float x = (float)kalmanY.Value;
            float y = (float)kalmanX.Value;

            if (x > -250 && y > -250)
            {
                PointF pos  = cam.WorldToScreen(x, y - 0.5f);
                float  size = cam.Scale(0.1f);
                g.FillEllipse(Brushes.Cyan, pos.X - size, pos.Y - size, size * 2, size * 2);
                g.DrawEllipse(new Pen(Color.Red, cam.Scale(0.007f)), pos.X - size, pos.Y - size, size * 2, size * 2);
            }
        }