Skip to content

Instantly share code, notes, and snippets.

@Be1zebub
Created August 1, 2023 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Be1zebub/d9154bbf10668802bb89708532791b6c to your computer and use it in GitHub Desktop.
Save Be1zebub/d9154bbf10668802bb89708532791b6c to your computer and use it in GitHub Desktop.
math.BezierSpline.lua
local spline = math.BezierSpline( {
Vector( 128, 128 ),
Vector( 384, 128 ),
Vector( 128, 384 )
} )
hook.Add( "HUDPaint", "math.BezierSpline", function()
surface.SetDrawColor(255, 255, 0)
for i = 1, #spline - 1 do
local pos = spline[i]
local pos2 = spline[i + 1]
surface.DrawLine(pos.x, pos.y, pos2.x, pos2.y)
end
end )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment