Exemplo n.º 1
0
        public override void Draw(SharpDXRenderer renderer)
        {
            Vector2 center = this.LastCursorPoint;
            Vector2 right  = this.LastCursorPoint + Vector2.UnitX * this.Width;
            Vector2 left   = SharpDXConverter.Vector2EUCtoSDX(MathUtils.RotatePoint(
                                                                  SharpDXConverter.Vector2SDXtoEUC(right),
                                                                  SharpDXConverter.Vector2SDXtoEUC(center),
                                                                  Angle));

            right = SharpDXConverter.Vector2EUCtoSDX(MathUtils.RotatePoint(
                                                         SharpDXConverter.Vector2SDXtoEUC(right),
                                                         SharpDXConverter.Vector2SDXtoEUC(center),
                                                         AngleRotation));
            left = SharpDXConverter.Vector2EUCtoSDX(MathUtils.RotatePoint(
                                                        SharpDXConverter.Vector2SDXtoEUC(left),
                                                        SharpDXConverter.Vector2SDXtoEUC(center),
                                                        AngleRotation));

            renderer.FillPolygon(this.BackColor, left, center, right);
            renderer.DrawPolygon(this.ForeColor, left, center, right);
            base.Draw(renderer);
        }
        public override void Draw(SharpDXRenderer renderer)
        {
            Vector2 center = this.LastCursorPoint;
            Vector2 right = this.LastCursorPoint + Vector2.UnitX * this.Width;
            Vector2 left = SharpDXConverter.Vector2EUCtoSDX(MathUtils.RotatePoint(
                            SharpDXConverter.Vector2SDXtoEUC(right),
                            SharpDXConverter.Vector2SDXtoEUC(center),
                            Angle));

            right = SharpDXConverter.Vector2EUCtoSDX(MathUtils.RotatePoint(
                            SharpDXConverter.Vector2SDXtoEUC(right),
                            SharpDXConverter.Vector2SDXtoEUC(center),
                            AngleRotation));
            left = SharpDXConverter.Vector2EUCtoSDX(MathUtils.RotatePoint(
                            SharpDXConverter.Vector2SDXtoEUC(left),
                            SharpDXConverter.Vector2SDXtoEUC(center),
                            AngleRotation));

            renderer.FillPolygon(this.BackColor, left, center, right);
            renderer.DrawPolygon(this.ForeColor, left, center, right);
            base.Draw(renderer);
        }