In lesson 15 we learn about the for
loop.
Sometimes you just want to do a variation on something five times, or ten times, or fifty times. The for
loop lets you do things multiple times. For example, the following code:
for (int i = 0 ; i < 6 ; i++) { ... }
lets you do something six times, depending on what you put inside the loop. The value of i
can be used to change how you do it each time.
Today we use the for
loop to make six disks that circle around each other in a cool animated pattern.
You can see this lesson by CLICKING HERE.
Somebody on Twitter posted a plausible final exam:
https://twitter.com/leondenise/status/953716696161882114
Very nice!
The author’s web site is a festival of shader hacks: http://shaderland.com/