예제 #1
0
 public static void CreateBezierVxs4(VertexStore vxs, Vector2 start, Vector2 end,
     Vector2 control1, Vector2 control2)
 {
     var curve = new VectorMath.BezierCurveCubic(
         start, end,
         control1, control2);
     vxs.AddLineTo(start.x, start.y);
     float eachstep = (float)1 / NSteps;
     float stepSum = eachstep;//start
     for (int i = 1; i < NSteps; ++i)
     {
         var vector2 = curve.CalculatePoint(stepSum);
         vxs.AddLineTo(vector2.x, vector2.y);
         stepSum += eachstep;
     }
     vxs.AddLineTo(end.x, end.y);
 }
예제 #2
0
        public static void CreateBezierVxs4(VertexStore vxs, Vector2 start, Vector2 end,
                                            Vector2 control1, Vector2 control2)
        {
            var curve = new VectorMath.BezierCurveCubic(
                start, end,
                control1, control2);

            vxs.AddLineTo(start.x, start.y);
            float eachstep = (float)1 / NSteps;
            float stepSum  = eachstep;//start

            for (int i = 1; i < NSteps; ++i)
            {
                var vector2 = curve.CalculatePoint(stepSum);
                vxs.AddLineTo(vector2.x, vector2.y);
                stepSum += eachstep;
            }
            vxs.AddLineTo(end.x, end.y);
        }