コード例 #1
0
 protected override void CalculateCornerPoints()
 {
     base.CalculateCornerPoints();
     CornerPoints.Add(ObjectVertices[0]); //corner points are added to show  on the editor
     CornerPoints.Add(ObjectVertices[10]);
     CornerPoints.Add(ObjectVertices[110]);
     CornerPoints.Add(ObjectVertices[120]);
 }
コード例 #2
0
    private Vector2 GetScale()
    {
        CornerPoints cornerPoints = new CornerPoints(selectedEntity.Rect);

        cornerPoints.Transform(x => Camera.main.WorldToScreenPoint(x));

        Vector2 startSize = cornerPoints.Size * SIZE_ANIMATION_START_SCALE;
        Vector2 endSize   = cornerPoints.Size * SIZE_ANIMATION_END_SCALE;

        return(Vector2.Lerp(startSize, endSize, AnimationCoefficient));
    }
コード例 #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            var cpos = new CornerPoints()
            {
                x0 = 10,
                y0 = -4.14213562,
                x1 = -4.14213562,
                y1 = 10,
                x2 = 10,
                y2 = 24.14213562,
                x3 = 24.14213562,
                y3 = 10,
            };

            var rightpos = new CornerPoints()
            {
                x0 = -10,
                y0 = -10,
                x1 = -10,
                y1 = 10,
                x2 = 10,
                y2 = 10,
                x3 = 10,
                y3 = -10,
            };

            var current = ToTransPos(cpos);
            var target  = ToTransPos(rightpos);

            var mat = CvInvoke.GetAffineTransform(current, target);

            var inputmat = new Mat();

            double[] xy = new double[] { 10, -4.14213562 };



            //var res = mat.Dot(2,1,DepthType.Cv64F , 1 , ,1);

            Console.WriteLine();
        }