Example #1
0
 public void Paint(Matrix2 world, IEnumerable<Line> lines)
 {
     foreach (var line in lines)
     {
         var p1 = world.TransformPoint(line.P1);
         var p2 = world.TransformPoint(line.P2);
         _graphics.DrawLine(Pens.Black, p1, p2);
     }
 }
Example #2
0
        public void Draw(ObjectPainter painter)
        {
            var angle = _time;
            var cos = (float) Math.Cos(angle);
            var sin = (float) Math.Sin(angle);
            var w = new Matrix2(cos, -sin, sin, cos);

            painter.Paint(w * new Matrix2(100, 0, 0, 100), _square);

            angle = _time*1.5f;
            cos = (float)Math.Cos(angle);
            sin = (float)Math.Sin(angle);
            w = new Matrix2(cos, -sin, sin, cos);
            painter.Paint(w * new Matrix2(200, 0, 0, 200), _square);
        }