Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local grid = 500
- local size = 2
- local maxIter = 150
- local threeD = false
- local ticks = 0
- local totalIter = 0
- local parts = {}
- function f(c, z) return z^2 + c end
- local set = Instance.new("Model", Workspace)
- for length = -grid/2, grid/2, size do
- for width = -grid/2, grid/2, size do
- ticks = ticks + 1
- if ticks % 250 == 0 then
- wait()
- end
- local iterations, z, c = 0, 0, 0
- local real = length * 4 / grid
- local imaginary = width * 4 / grid
- while f(c, z) <= 4 and iterations < maxIter do
- totalIter = totalIter + 1
- iterations = iterations + 1
- local new = z^2 - c^2 + real
- c = 2*z*c + imaginary
- z = new
- end
- local part = Instance.new("Part", set)
- part.FormFactor = Enum.FormFactor.Custom
- part.TopSurface = Enum.SurfaceType.Smooth
- part.Anchored = true
- part.Locked = true
- part.Size = Vector3.new(size, (threeD and (iterations < maxIter and iterations*2 or 1) or 1), size)
- part.CFrame = CFrame.new(length, 0, width)
- part.BrickColor = BrickColor.new(Color3.new(0, 0, ((iterations < maxIter and ((255 / maxIter*10) * iterations) / 255) or 0)))
- end
- end
- print(("Complete\nPixles: %s\nIterations: %s"):format(tostring(#set:GetChildren()), tostring(totalIter)))
- game.Players.CharacterAutoLoads = true
- for _, player in ipairs(game.Players:GetPlayers()) do
- player:LoadCharacter()
- end
Advertisement
Add Comment
Please, Sign In to add comment