Simple Python Turtle Graphic and Code: Overlapping Squares смотреть онлайн
A group of squares made more visually appealing by the gradual decrease in size and change in hue of every shape that overlaps the preceding one. The simple Python Turtle code uses the colormode(1.0) to facilitate transition from initial color to terminal one. The code allows the user to alter the initial and terminal colors.
Feel free to copy the basic Python Turtle code that is given below. Don't hesitate to ask questions about the code if you have any. Enjoy! Please comment, like, or subscribe :)
Incidentally, for manually colorable graphics and variations, please visit my author site at https://www.amazon.com/author/basicpythonturtleart.url
import turtle
t = turtle.Turtle() #Definitions and Initializations
screen = turtle.Screen()
t.pensize(4)
screen.colormode(1.0) #Requirement for use of numbers from 0 to 1.0 as color r, g, and b values
size = 250 #Changeable; Distance from center to vertex of square
number_of_rotations = 15 #Changeable; Count of stepwise rotations for the square over 360-degree span
size_change = size / number_of_rotations #Change in dimension of square for every stepwise rotation
r1 = r = 1 #Changeable to a number from 0 to 1.0 for each of r1, g1, and b1;
g1 = g = 0 #Initial (r1, g1, b1) = (1, 0, 1) for "violet"; (r, g, b) -- value holders
b1 = b = 1 #of stepwise changes in red, green, and blue values
r2 = 1 #Changeable to a number from 0 to 1.0 for each of r2, g2, and b2;
g2 = 1 #Target (r2, g2, b2) = (1, 1, 0) for "yellow"
b2 = 0
r_change = (r2 - r1) / number_of_rotations #Change in red value per stepwise rotation
g_change = (g2 - g1) / number_of_rotations #Change in green value per stepwise rotation
b_change = (b2 - b1) / number_of_rotations #Change in blue value per stepwise rotation
angle_change = 360 / number_of_rotations #Angular change per stepwise rotation
t.penup() #Python_Graphic start of drawing procedure
for j in range(number_of_rotations): #Loop to draw variously-sized and colored squares, one each for every rotation
t.forward(size) #Trail-less movement of turtle to starting point of drawing one square
t.left(135)
t.pendown()
t.fillcolor(r, g, b) #Color fill procedure for current square
t.begin_fill()
for i in range(4): #Drawing of square's four sides
t.forward(size * (2 ** (1 / 2)))
t.left(90)
t.end_fill()
r += r_change #Stepwise changes in values or r, g, and b for next square
g += g_change
b += b_change
size -= size_change #Stepwise change in dimension for next square
t.penup()
t.home()
t.left((1 + j) * angle_change) #Angular rotation of turtle to start drawing of next square
t.hideturtle()
screen.exitonclick()
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Simple Python Turtle Graphic and Code: Overlapping Squares» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.