top of page
Learning Graphics Programming


chrisbentley349
Nov 28, 20241 min read
Â
Â
Â


CS Lesson #10: Turtle Graphics
Notes: Code (Pygame): Code (online IDE):: Hints:
chrisbentley349
Nov 27, 20241 min read
Â
Â
Â


Lesson #6: Colored Lines and Vector Functions
Notes: Code: Hints: Step #1: Adding per-pixel color The only difference is the additional arguments for red, green, blue: Now we set...
chrisbentley349
Nov 3, 20241 min read
Â
Â
Â


Lesson #7: Texturing
Notes: Code: Resources (Textures):: Hints; Procedural texture data: Hard-coded texture data Code to read .ppm file:
chrisbentley349
Nov 2, 20241 min read
Â
Â
Â


Lesson #8: Image Processing
Notes: Code: Hints:
chrisbentley349
Nov 1, 20241 min read
Â
Â
Â


Lesson #9: 3D Modeling
Notes: Code: Hints:
chrisbentley349
Oct 30, 20241 min read
Â
Â
Â


Lesson #10: Games
Notes: Code: Pong Gravity Simulation Asteroids Flappy Bird Platformer
chrisbentley349
Oct 29, 20241 min read
Â
Â
Â


Lesson #11: Alpha Blending
Notes: Code (Delta): Code (Full):
chrisbentley349
Oct 28, 20241 min read
Â
Â
Â


Math Lesson #6: Tower of Hanoi
Goal: move the stack of discs from "source" peg to "target" peg Rules: a) move only one disc at time, b) never put bigger disc on top of a smaller Questions: a) how to do it? b) how many moves needed for stack of n discs? Let's gain intuition, by solving simpler versions... A) stack of one disc... easy, just move lone disc... number of moves = 1 B) stack of two discs... move smallest to spare peg, base disc to target, smallest to target... number of moves = 3 C) stack
chrisbentley349
Oct 27, 20241 min read
Â
Â
Â


Lesson #12: Depth Buffer
Notes: Code (Delta): Code (Full):
chrisbentley349
Oct 26, 20241 min read
Â
Â
Â


Lesson #13: Modelling a Cube
Notes: Code (Delta): Code (Full):
chrisbentley349
Oct 25, 20241 min read
Â
Â
Â


chrisbentley349
Oct 25, 20241 min read
Â
Â
Â


Math Lesson #8: Sets and Subsets
What's a set? A set is just a collection of items... in the case above it's a mini steam engine, a mango and a padlock... And what's a subset? It's just a collection of some or even all or none of those items... here the mini steam engine is missing... How many subsets can you make from a given set? For example, how many subsets can you make if your set has 3 items? To get a feeling for this, let's start with simpler cases... case 1: how many subsets if your set has 1 it
chrisbentley349
Oct 25, 20242 min read
Â
Â
Â


Lesson #14: Perspective
Notes: Code (Delta): Code (Full):
chrisbentley349
Oct 24, 20241 min read
Â
Â
Â


Math Lesson #9: How many 3-letter combinations?
How many combinations of 3 English letters exist? Any combination is fine, even if it's not a valid Engish word. So, "rkq" and "hhh" are ok... Well, there are 26 English letters, so there are 26 choices for the 1st letter: And 26 choices for the 2nd: And 26 choices for the 3rd: So, the total number of possibilities is 26 * 26 * 26 = 17,576... pretty cool!
chrisbentley349
Oct 24, 20241 min read
Â
Â
Â


Lesson #15: Fog
Notes: Code (Delta): Code (Full):
chrisbentley349
Oct 23, 20241 min read
Â
Â
Â


Math Lesson #10: How many ways to re-order 3 cards?
How many ways to order 3 cards? Well, we can chose the ace first... that leaves us two choices for the second card, the 4 or the 9: So, we have either "Ace, 4, 9" or "Ace, 9, 4": Or, we can choose to start with the 9, which again leaves us with two choices for the second card: So, we have either "9, 4, Ace" or "9, Ace, 4": Finally, we can chose to start with the 4, which leaves two choices for the next card, the 9 or the Ace: So, we have either "4, Ace, 9" or "4, 9, Ace": Tak
chrisbentley349
Oct 22, 20241 min read
Â
Â
Â


Math Lesson #11: How many hands of 5 cards?
Well, there are 52 cards in a deck, so there are 52 choices for the first card: Leaving 51 choices for the second card: And 50 choices for the third card: And 49 for the fourth card: And 48 for the fifth card: So, this is 52 x 51 x 50 x 49 x 48 = 311,875,200 But, in poker it doesn't matter if you pull an Ace first or last... so we need to ignore the different order our cards can land in our hand. We saw in Math Lesson #10 that there are 5! = 120 ways of ordering 5 cards, so
chrisbentley349
Oct 21, 20241 min read
Â
Â
Â


Math Lesson #3: Vectors
Notes:
chrisbentley349
Oct 21, 20241 min read
Â
Â
Â


Lesson #16: Sphere and Mesh
Code (Delta): Code (Full):
chrisbentley349
Oct 21, 20241 min read
Â
Â
Â
bottom of page