159
edits
Line 29: | Line 29: | ||
<source lang="python"> | <source lang="python"> | ||
###LOAD LIBRARIES ### | |||
from vapory import * | from vapory import * | ||
Line 34: | Line 36: | ||
from random import* | from random import* | ||
from PIL import Image | from PIL import Image | ||
###CREATE FUNCTION### | |||
def create_3D(): | def create_3D(): | ||
###DEFINE VARIABLES### | |||
#image.save("process.png") | #image.save("process.png") | ||
n_boxes=randint(25,34) | n_boxes=randint(25,34) | ||
Line 42: | Line 49: | ||
distances2 = [1*j for j in range(n_boxes)] | distances2 = [1*j for j in range(n_boxes)] | ||
###CREATE BOXES AT RANDOM LOCATIONS AND ASIGN IMAGE AS MAP### | |||
box= [Box([-0.5+y/4, -0.5+x/4, -0.5],[0.5+y/4,x/4+0.5,0.5],Texture('uv_mapping', | box= [Box([-0.5+y/4, -0.5+x/4, -0.5],[0.5+y/4,x/4+0.5,0.5],Texture('uv_mapping', | ||
Pigment( ImageMap('png', '"process.png"')), | Pigment( ImageMap('png', '"process.png"')), | ||
Line 50: | Line 57: | ||
for x in distances2 | for x in distances2 | ||
] | ] | ||
###SET UP SCENE FOR RENDERING AND SAVING THE FILE#### | |||
tt=[Background( "color", [0,0,0] )] | tt=[Background( "color", [0,0,0] )] |
edits