A "general" programming learning resource for 2D and 3D CG: Scratch-a-Pixel
(Quoted from here)Scratch-a-Pixel is the first resource on web to teach 2D and 3D computer graphics programming techniques from the ground up. We have paid a great deal of attention to explain all the mathematical and technical terms with the simplest possible words to reach the largest possible audience.
We also believe in teaching by example. Many people understand the theory much better (especially when it relies on abstract mathematical concepts) when they are provided with a practical example. Techniques discussed in lessons are also implemented in small self-contained C++ programs.
We have created a set of lessons in the basic section that we recommend you to read in chronological order, especially if you are new to this field. They have been designed to let you gradually learn about the most common techniques used in computer graphics. It is recommended that you read this series of lessons before you jump to some more advanced topics.