News:

Come Chat with us live! Learn how HERE!

Main Menu

tcMod transform

Started by seeeker, July 16, 2008, 06:24:10 PM

seeeker

Can anyone please help me understand what exactly does it do?

QuotetcMod 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

Lava Croft

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.

Bissig

Quote from: seeeker on July 16, 2008, 06:24:10 PM
Can anyone please help me understand what exactly does it do?

QuotetcMod 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 ;-)

Taiyo.uk


CreatureofHell

{NoS}StalKer
Quote<Timbo> posting on the trem forums rarely results in anything good

Bissig

Quote from: Taiyo.uk on July 17, 2008, 07:38:23 PM
Matrix math.

[no offence]
Ok, smart man, what are those t0 and t1s then? Vectors and Matrices often come in one package. 8-)

gimhael

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.


Taiyo.uk

Quote from: Bissig on July 18, 2008, 01:04:00 AM
Quote from: Taiyo.uk on July 17, 2008, 07:38:23 PM
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!

Lava Croft

seeeker, do please update us (actually, just me is fine too) about what the hell it does.

Bissig

Quote from: gimhael on July 18, 2008, 06:56:24 AM
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 ;_)

gimhael

"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