Advertisement

Linear transforms

Started by June 19, 2013 11:23 PM
4 comments, last by lipsryme 11 years, 8 months ago

I'm currently reading Realtime Rendering 3rd edition and there's a part about linear transforms that I'm not quite getting.

It says a function such as f(x) = x + (7, 3, 2) is not a linear transform. A linear transform is defined as being one that preserves vector addition and scalar multiplication. I know that this is a translation, which is not a linear transform as it seems but why exactly is that ?

How does the above function not preserve vector addition and scalar multiplication ? What I'm seeing is a vector being added to another vector...?

A matrix multiplication technically cannot do translation. The translation you typically see is a result of using 3-dimensional homogeneous coordinates, basically four-component three-dimensional vectors, where you can take advantage of the fourth component to do translation of the first three components.

So no, three-dimensional translation is not a linear operation with three-dimensional vectors and matrices. For example, linearity states that f(x+y)=f(x)+f(y), and that f(a*x)=a*f(x). You can just insert some basic values, such as x=[1, 0, 0] and y=[0, 1, 0], to see that the two identities do not hold for your function.

Advertisement

Brother Bob has given the definition.

From the definition we see that f(x) = f(x + 0) = f(x) + f(0) so for that identity to hold we see that f(0) == 0 for a linear mapping.

A (non-zero!) translation is therefore not linear since it does not map the origin onto the origin. It is called an affine transformation. http://en.wikipedia.org/wiki/Affine_transformation

Homogeneous coordinates can express affine transformations as a matrix multiplication (the origin of 3d space in homogeneous coordinates is not 0 but (0, 0, 0, w) for w != 0).

An "affine space" is a vector space plus a translation. http://en.wikipedia.org/wiki/Affine_space

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

I understand what you're saying...what I still don't quite get is the definition.

so if I replace x with 0 I'd get f(0) = f(0 + 0) = f(0) + f(0) = 0 ?

And if I were to put something != 0 inside of it wouldn't it be the same just 1 instead of 0 ?

How is f((1, 0, 0) + (0, 1, 0)) different from f((1, 0, 0)) + f((0, 1, 0)) ?

Your function is f(x) = x+[3,7,2], so you have the following:

  1. f([1,0,0]) = [4,7,2]
  2. f([0,1,0]) = [3,8,2]
  3. f([1,0,0]+[0,1,0]) = f([1,1,0]) = [4,8,2]
  4. f([1,0,0]) + f([0,1,0]) = [4,7,2] + [3,8,2] = [7,15,4]

Clearly point 3 is not equal to point 4.

I see, I think I got it now, thanks guys smile.png

This topic is closed to new replies.

Advertisement