Arama butonu
Bu konudaki kullanıcılar: 1 misafir
5
Cevap
165
Tıklama
0
Öne Çıkarma
Şu kodu python'da nasıl çalıştırabilirim
S
8 yıl
Teğmen
Konu Sahibi

from visual import *

floor = box (pos=(0,0,0), length=4, height=0.5, width=4, color=color.blue)
ball = sphere (pos=(0,4,0), radius=1, color=color.red)
ball.velocity = vector(0,-1,0)
dt = 0.01

while 1:
rate (100)
ball.pos = ball.pos + ball.velocity*dt
if ball.y < ball.radius:
ball.velocity.y = abs(ball.velocity.y)
else:
ball.velocity.y = ball.velocity.y - 9.8*dt



http://vpython.org/contents/bounce_example.html

Ne yaptıysam çalıştıramadım, ImportError: No module named visual hatası veriyor. Nasıl çalıştırabilirim bu kodu