21.12.2022 Views

python_para_desenvolvedores_2ed

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Blender 295

for j in (-3, 3):

coluna(i, j, z)

# Cria escada

for i in xrange(8):

local = 0., 0., i / 32. - .25

tam = 3.3 + (8. - i) / 8., 3.3 + (8. - i) / 8., .25

objeto(local, tam, mat)

# Cria teto

for i in xrange(35):

local = 0., 0., 2.9 + i / 60.

tam = 3.5 - i / 200., 3.5 * ( 1. - i / 35.), .1

objeto(local, tam, mat)

# Pega o "mundo"

world = Blender.World.Get()[0]

# Modo "blend" no fundo

world.skytype = 1

# Atualiza a cena

cena.update()

Saída (renderizada):

Exemplo com interface:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!