CG programming for non-programmers, lesson 13

One nice thing about defining functions is that you can call them more than once.

In lesson thirteen we see an example of creating two disks, both calling the same function disk(x,y,r), but with different arguments.

One disk is red, and the other is green. That’s because we use them to create the color:

      vec3(c1, c2, 0.1)

The red component of this color is c1, which has a high value only inside the first disk, the green component is c2, which has a high value only inside the second disk, and the blue component is 0.1, which gives us a dark blue background everywhere.

You can see this lesson by CLICKING HERE.

Leave a Reply

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