Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image
- from math import radians, degrees, cos, sin
- from IPython.core import display
- from io import BytesIO
- from os import chdir
- img = Image.new( 'RGB', (721,721), "white") # create a new white image
- pixels = img.load() # create the pixel map
- class cart:
- def __init__(self, x, y, z):
- self.x = zeros(x, dtype = int16)
- self.y = zeros(y, dtype = int16)
- self.z = zeros(z, dtype = int16)
- maps = array([cart(721, 721, 721) for x in range(720)])
- midx, midy = 360, 360
- for q in range(1,721):
- for s in range(1,361):
- for t in range(1,361):
- #print(s,t,q)
- maps[q].x[t] = (cos(radians(s)) * t) + 350
- maps[q].y[t] = (sin(radians(t)) * s) + 350
- maps[q].z[t] = s
- x = maps[q].x[t] - 350
- z = maps[q].z[t]
- x = round(cos(radians(q/2)) * x - sin(radians(q/2)) * z)
- maps[q].x[t] = x + midx
- maps[q].x[t] = min(max(maps[q].x[t], 0), 720)
- maps[q].y[t] = min(max(maps[q].y[t], 0), 720)
- #print(int(maps[q].x[t]), int(maps[q].y[t]))
- pixels[abs(int(maps[q].x[t])), abs(int(maps[q].y[t]))] = (t%s, s%t, s^t)
- print(q)
- img = img.rotate(180)
- img.save('image{0}.png'.format(q), 'png')
- img = Image.new( 'RGB', (721,721), "white")
- pixels = img.load()
Advertisement
Add Comment
Please, Sign In to add comment