21.12.2022 Views

python_para_desenvolvedores_2ed

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Imagens em três dimensões 257

while True:

# Inverte o sentido em x

if abs(fr.x) > 4.2:

delta_x = -delta_x

# Inverte o sentido em z

if abs(fr.z) > 3.1:

delta_z = -delta_z

fr.x += delta_x

fr.z += delta_z

# Rotaciona em Pi / 100 no eixo

fr.rotate(angle=pi / 100, axis=eixo)

# Espere 1 / 100 segundos

rate(250)

Janela 3D:

O pacote inclui também um módulo de plotagem de gráficos, chamado graph.

Exemplo:

# -*- coding: latin1 -*-

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

Saved successfully!

Ooh no, something went wrong!