Python 3D Graphics Tutorial 2: Animating 3D Objects in Vpython

preview_player
Показать описание
You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:

In this video we show step-by-step instructions on how to animate three dimensional objects in vpython, (visual python), and how to bring your models to life. I do not assume you are an expert, so these lessons are designed for complete beginners.
#Python
#Lessons
#Programming
Рекомендации по теме
Комментарии
Автор

I improved on the code by adding two more balls, one moving along the y-axis and one along the z-axis. I also changed the 5 into 4.3 to stop the balls moving a little into the wall, and I am legend. Thank you Paul.

abdullahchoudhury
Автор

I followed all the series so far, they are great ! Thank you for being such an amazing teacher!

soheilmohammadi
Автор

Great stuff! I also like that you do not edit away blunders, this looks like true programming!

lamp
Автор

Thanks Paul! I folded like cheap lawn chair : ( However, I repeated the lesson in order to visualize the 3D concept. That alone'
was a time well spent...You never disappoint. Far from quitting, I will get better at it....

edSabio
Автор

this is the first video from you I saw - and you got me at the point where you mentioned the coffee :D

jollyme
Автор

Youve helped me so much thanks
from vpython import *
from time import *
ball=box(pos=vector(0, -5, 0), color=color.white, length=9, height=1, width=9)
ceiling=box(pos=vector(0, 5, 0), color=color.white, length=9, height=1, width=9)
leftwall=box(pos=vector(-5, 0, 0), color=color.white, length=1, height=11, width=9)
backwall=box(pos=vector(5, 0, 0), color=color.white, length=1, height=11, width=9)
backwall=box(pos=vector(0, 0, -5), color=color.red, length=11, height=11, width=1)
while True:
pass

ngtowqh
Автор

Wow, that was great! My students tend to like programming lessons that provide something other than hundreds of lines of code on a page, this is great! Thanks for another great lesson. I use python for robotics and IoT projects, so I had no idea about the visual end of it (other than some slight knowledge about creating GUIs). My students are going to go nuts over this. Thanks for your hard work and dedication!

hughpatterson
Автор

I AM LEGEND! I’ve been doing work on my CNC Router so the x, y, z was throwing me off too. I added a comment before the walls to remind me which direction I needed to go in.

warrenscorner
Автор

Hi Paul, I got the bulk of the problem worked out okay until I got to the oscillating marbel. I refused to cheat and view the next lesson so I stubbornly tried While loops and If statements but all the time using Time Delays. I worked right through till midnight and gave up defeated: I folded like a cheap deck chair from Walmart. It's sad to see a 76yo crying in misery! Anyway I woke the next morning and did your next lesson and learnt a lot. Thanks for another amazing learning experience!

alfredcalleja
Автор

I'm a legend. Managed to do the room on my own. Being a bit of a perfectionist I went to the extremes of subtracting the wall thicknesses from the dimensions and positions in order to get clean but joints at the corners. :P I'm enjoying it a lot and willing to learn more with your excellent help and tutorials.

ecassar
Автор

I got it to work. If you change your if statement in the while loop, to:

if (xPos > (5-marble.radius) or xPos < (-5+marble.radius)):
deltaX=deltaX*(-1)

The ball will appear to change direction when it makes contact with a side wall rather the half way through the wall.

bassman
Автор

thankyou from Italy, you speak slowly and I can understand everything

glaucopassalacqua
Автор

I AM LEGEND! This 3D graphics and animation is cool! Looking forward to more neat stuff.

cbrombaugh
Автор

I Folded like a cheap lawn I did get sidetracked on making an entire house with a sky and cloud as the skybox before I did this lesson... But I still loved the lesson! Thank you for teaching me how to animate in python! 👍(I also color coded the walls for troubleshooting, and because it looked old, so I went with it) AY THE BALLS' JAILBREAKIN GET IT!

LiamAllbright
Автор

As a teacher of 60 years experience, I'm impressed by the deliberate mistakes, that you then "discover".

tomagain
Автор

mister you are a amazing teacher, thank you

josueruiz
Автор

I am LEGEND. After getting vpython working I am having fun.

petefontana
Автор

I appreciate your clear explanation and step-by-step approach

alfredcheung
Автор

Thanks to your good teaching I am becoming a legend

williamhyrkas
Автор

Wow how cool is to learn slower and chilly 😊 instead to rush as 90% devs do.

markojotovic