CG programming for non-programmers, lesson 15

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.

3 thoughts on “CG programming for non-programmers, lesson 15”

Leave a Reply

Your email address will not be published. Required fields are marked *