Computer Graphics: Mathematics and Code

First, let's start with my mathematical background. I took calculus I - IV and differential equations. I spent the first semester of computer graphics, where we implemented pretty much our own graphics pipeline, including shading using Phong without any graphics API.

This semester, I took Advanced Computer Graphics at the graduate level, and reading math, she loses me. This class is mainly an image synthesis. We will build a ray tracer in our first project and build it from now on.

When reading on advanced computer graphics, I usually get a bunch of math. I understand that computer graphics is hard math, but I am having trouble trying to figure out how I can implement math in code. I really need to understand this to succeed in CG.

For example, this article is from the GPU Gems: http://http.developer.nvidia.com/GPUGems/gpugems_ch01.html There's a bunch of math, but I don't know where to start the math implementation if I want.

So, is there something I am missing? Should I take a look at the math and get the code? Are there any tutorials / books that can help me understand what I need to do?

+7
source share
3 answers

This article uses FFTs or actually inverse FFTs to generate a field of moving height. Read the FFT. To make 2d, you first make 1d FFT on the rows, then the columns. Once you have a height field, partial derivatives are likely to be obtained by taking the difference in adjacent heights along the x or y axis, depending on which part it is in. At first glance, I don’t see the integrals there, but they appear in some graphic documents, and there are methods for estimating them.

I can also recommend visiting the ompf forum: http://ompf.org/forum/

0
source

Programming for the kind of math you see in the GPU gems article usually falls under numerical analysis. A more applied aspect of numerical analysis will be considered in a course or book on numerical methods or scientific programming. I suggest starting with a wikipedia article in numerical analysis and taking a look at some of the related articles. Once you know the names of some of the relevant methods, sample code is easy to find.

Tip: most executable derivatives and integrals are just learning how to handle constraints (in the mathematical sense) in your programs. Often this is not explicitly stated.

+1
source

One piece of advice that I can give besides “learning more about mathematics and practice” is that some mathematical constructions, as a rule, have a similar construction in the code, this simply cannot be obvious.

Integrals (and sums) are often implemented as loops in the code or as sums over frames (this often happens in a graph). Derivatives and partial are changes between values, which usually appear as deltas within frames or between discrete elements such as pixels.

These rules do not stand 100%, but if you can start looking at the more frightening mathematical elements in terms of what code they generate, this will facilitate its absorption. It is important to work with a solid foundation, so make sure you have the basics and the rest with experience and practice.

0
source

All Articles