Advertisement
Guest User

Untitled

a guest
Dec 14th, 2018
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. void DrawBSpline(int steps = 10)
  2.         {
  3.             Point[] points = new Point[]
  4.             {
  5.                 new Point(0, 0),
  6.                 new Point(36, 75),
  7.                 new Point(108, 75),
  8.                 new Point(135, 0)
  9.             };
  10.             int[] knots = new int[] { 0, 1, 2, 3 };
  11.             Point previous = deBoor(0, 2, 0f, knots);
  12.             for (int i = 1; i < steps; i++)
  13.             {
  14.                 float time = (float)i / (steps - 1);
  15.                 float t = time * (points.Length - 1);
  16.                 Point point = deBoor(0, 2, t, knots);
  17.                 //DrawLine(point, previous);
  18.                 previous = point;
  19.             }
  20.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement