To do this firstly we want to install vpython module
_______________
pip install vpython
By typing above line in the terminal you can install the vpython module
code
_____
from vpython import *
canvas(background= color.black)
top = ring(radius=0.4, thickness=0.24, color=vector(1, 1, 0))
choco = ring(radius=0.55, thickness=0.25, color=vector(0.4, 0.2, 0))
radius = 0
while True:
rate(30)
top.pos = vector(4*cos(radius), sin(radius), 0)
choco.pos = vector(4*cos(radius), sin(radius), 0)
radius = radius + 0.01
You can try with different color and different angles 😊
#pythonprogramming
#shorts
#python
Sur cette page du site, vous pouvez voir la vidéo en ligne Make a Rotating 3D chocolate Donut Using python vpython module | durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Akshaya H 08 octobre 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 158 fois et il a aimé 10 téléspectateurs. Bon visionnage!