Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. function draw.Circle( x, y, radius, seg )
  2. local cir = {}
  3.  
  4. table.insert( cir, { x = x, y = y, u = 0.5, v = 0.5 } )
  5. for i = 0, seg do
  6. local a = math.rad( ( i / seg ) * -360 )
  7. table.insert( cir, { x = x + math.sin( a ) * radius, y = y + math.cos( a ) * radius, u = math.sin( a ) / 2 + 0.5, v = math.cos( a ) / 2 + 0.5 } )
  8. end
  9.  
  10. local a = math.rad( 0 ) -- This is need for non absolute segment counts
  11. table.insert( cir, { x = x + math.sin( a ) * radius, y = y + math.cos( a ) * radius, u = math.sin( a ) / 2 + 0.5, v = math.cos( a ) / 2 + 0.5 } )
  12.  
  13. surface.DrawPoly( cir )
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement