Advertisement
Guest User

Bezier Curve (WIP)

a guest
Sep 22nd, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.33 KB | None | 0 0
  1. function DrawCurve(P1, P2, P3, Precision)
  2.     local PointTable = {}
  3.     for i = 1, Precision do
  4.         local Percent = i/Precision
  5.         local Mark1, Mark2 = {P1[1]+(P2[1]-P1[1])*Percent, P1[2]+(P2[2]-P1[2])*Percent}, {P2[1]+(P3[1]-P2[1])*Percent, P2[2]+(P3[2]-P2[2])*Percent}
  6.         PointTable[i] =
  7.     end
  8. end
  9.  
  10. DrawCurve({1, 4}, {3, 7}, {-4, 9}, 10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement