Make a Rotating 3D chocolate Donut Using python vpython module |

Published: 08 October 2022
on channel: Akshaya H
158
10

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


On this page of the site you can watch the video online Make a Rotating 3D chocolate Donut Using python vpython module | with a duration of hours minute second in good quality, which was uploaded by the user Akshaya H 08 October 2022, share the link with friends and acquaintances, this video has already been watched 158 times on youtube and it was liked by 10 viewers. Enjoy your viewing!