Tremulous Forum
Media => Mapping Center => Topic started by: seeeker on July 16, 2008, 06:24:10 pm
-
Can anyone please help me understand what exactly does it do?
tcMod transform m00 m01 m10 m11 t0 t1
Transforms each texture coordinate as follows:
S' = s * m00 + t * m10 + t0
T' = s * m01 + t * m11 + t1
This is for use by programmers.
Ive seen it being used on several places.
=/
thanks
-
All shaders I can find that use tcMod transform are related to liquids. I suggest you just try to use Google to steal a shader from somewhere and see what it does.
-
Can anyone please help me understand what exactly does it do?
tcMod transform m00 m01 m10 m11 t0 t1
Transforms each texture coordinate as follows:
S' = s * m00 + t * m10 + t0
T' = s * m01 + t * m11 + t1
This is for use by programmers.
Ive seen it being used on several places.
=/
thanks
That's vector math. Get a book ;-)
-
Matrix math.
-
granger math
-
Matrix math.
[no offence]
Ok, smart man, what are those t0 and t1s then? Vectors and Matrices often come in one package. 8-)
-
the only thing that makes this different from the textbook formula for an affine transformation of a vector is that the components are named s and t instead of e.g. x0 and x1. Rename them and you'll see that
y0 = x0 * m00 + x1 * m10 + t0
y1 = x0 * m01 + x1 * m11 + t1
is exactly the same as
y = x * m + t.
-
Matrix math.
[no offence]
Ok, smart man, what are those t0 and t1s then? Vectors and Matrices often come in one package. 8-)
[no offense]
Ok, smart man, I'm going to sit on my high chair and insist that the so-called vector (t0, t1) you speak of is in fact a [1,2] matrix, and that all so-called scalars are just [1,1] matrices. So there. thpppppppt!
-
seeeker, do please update us (actually, just me is fine too) about what the hell it does.
-
the only thing that makes this different from the textbook formula for an affine transformation of a vector is that the components are named s and t instead of e.g. x0 and x1. Rename them and you'll see that
y0 = x0 * m00 + x1 * m10 + t0
y1 = x0 * m01 + x1 * m11 + t1
is exactly the same as
y = x * m + t.
Thanks for shining a light into those dark memories that never shall rise again (vector math) 8-)
@Taiyo.uk
Hahahaha, twas funny ;_)
-
"What it does" depends on the concrete values of all those little ms and ts, but usually this is used to change from one coordinate system to another. (maybe tc=transform coordinates ?)
You will find lots of examples for this kind of transformation in any linear algebra or computer graphics book. If you intend to read and understand the code of 3d computer games, you should learn the basics of Vector / Matrix maths. It's not as difficult as it may look in the beginning.
@Taiko: don't forget that the 2x2 matrices form a 4-dimensional vector space, so all your precious matrices are by definition vectors. ;D