Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function DrawVoxelTriangle(a,b,c)
- local lerp = math.max((b-a).magnitude,(c-a).magnitude)
- for L1 = 0,1,1/lerp do
- local p1 = a:lerp(b,L1)
- local p2 = c:lerp(b,L1)
- local dist = (p2-p1).magnitude
- for L2 = 0,1,1/dist do
- local p = p1:lerp(p2,L2)
- workspace.Terrain:SetCell(p.X,p.Y,p.Z,1,0,0)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement