Live data from Hacker News

Introduction to the Math of Computer Graphics

codeofthedamned.com

31–35 of 35 posts

Re: Introduction to the Math of Computer Graphics

#31
post #22

This post is mistitled, and I really wish I knew where to find a thing that is what this post claims to be. From the title, I was hoping this would cover coordinate systems, the Bresenham line algorithm and midpoint circle algorithm, Lambertian reflection, perspective transformation, quaternions, Gouraud and Phong shading, rotation, metaball approximation, parametric vs. implicit vs. explicit function representation,…

Matrix multiplication by vector and vice versa is a multiplication by at least one non-square matrix. But matrix addition, on the other hand, is something I have never seen come up in graphics.

Translation itself is not a linear transformation. To simply translate a vertex is a matrix addition(subtraction) problem.

The only reason that it is possible in the transformation matrix is because of the addition of the fourth parameter in a vertex [x y z 1] to create a homogenous linear system. This allows the translation to become a part of the transformation matrix.

Re: Introduction to the Math of Computer Graphics

#32

Earlier quoted context omitted.

Matrix multiplication by vector and vice versa is a multiplication by at least one non-square matrix. But matrix addition, on the other hand, is something I have never seen come up in graphics.

Translation itself is not a linear transformation. To simply translate a vertex is a matrix addition(subtraction) problem. The only reason that it is possible in the transformation matrix is because of the addition of the fourth parameter in a vertex [x y z 1] to create a homogenous linear system. This allows the translation to become a part of the transformation matrix.

I am not sure what you mean. If by "matrix addition" you meant adding vectors then it's obvious but adding actual matrices won't give you any translation operators because no matter how many matrices you have added together you still end up with a matrix, which, indeed, can only represent linear operators.

Re: Introduction to the Math of Computer Graphics

#33
too much maths, not enough understanding.

i worked out a lot of 3d stuff for myself early on, and the linear algebra approach is quite confusing vs. taking an intuitive approach and noticing that somethings are the same or special cases of...

... maybe i should write something about this.

Re: Introduction to the Math of Computer Graphics

#34

Small thing, but some of the examples have some pretty bad undefined behavior bugs. For instance: Matrix& operator*( const double scalar, const Matrix& rhs) { Matrix result(rhs); result *= scalar; return result; } (Returning a reference to a stack variable is undefined behavior, but realistically you're probably either looking at a hard crash or a really hard to track down bug)

that should be a compile error, surely? 'returning a reference or address of a temporary' or similar... i guess warnings as errors and having warnings to the max has spoiled me.

Re: Introduction to the Math of Computer Graphics

#35

Earlier quoted context omitted.

Translation itself is not a linear transformation. To simply translate a vertex is a matrix addition(subtraction) problem. The only reason that it is possible in the transformation matrix is because of the addition of the fourth parameter in a vertex [x y z 1] to create a homogenous linear system. This allows the translation to become a part of the transformation matrix.

I am not sure what you mean. If by "matrix addition" you meant adding vectors then it's obvious but adding actual matrices won't give you any translation operators because no matter how many matrices you have added together you still end up with a matrix, which, indeed, can only represent linear operators.

I believe we are mincing words with the added confusion of two mathematical meanings for the word vertex in this discussion.

The single row matrix, called a vertex, and a Euclidean vertex which we use to represent the points in the geometry, and happen to store in a vertex (matrix).

I do agree with your statement.

Post reply on HN