Author Topic: tcMod transform  (Read 5657 times)

seeeker

  • Posts: 122
  • Turrets: +19/-5
tcMod transform
« on: July 16, 2008, 06:24:10 pm »
Can anyone please help me understand what exactly does it do?

Quote
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

Lava Croft

  • Guest
Re: tcMod transform
« Reply #1 on: July 16, 2008, 08:03:14 pm »
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

  • Posts: 1309
  • Turrets: +103/-131
Re: tcMod transform
« Reply #2 on: July 17, 2008, 03:14:44 am »
Can anyone please help me understand what exactly does it do?

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

Taiyo.uk

  • Posts: 2309
  • Turrets: +222/-191
    • Haos Redro
Re: tcMod transform
« Reply #3 on: July 17, 2008, 07:38:23 pm »
Matrix math.

CreatureofHell

  • Posts: 2422
  • Turrets: +430/-126
    • Tremtopia
Re: tcMod transform
« Reply #4 on: July 17, 2008, 08:17:31 pm »
granger math
{NoS}StalKer
Quote
<Timbo> posting on the trem forums rarely results in anything good

Bissig

  • Posts: 1309
  • Turrets: +103/-131
Re: tcMod transform
« Reply #5 on: July 18, 2008, 01:04:00 am »
Matrix math.

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

gimhael

  • Posts: 546
  • Turrets: +70/-16
Re: tcMod transform
« Reply #6 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.


Taiyo.uk

  • Posts: 2309
  • Turrets: +222/-191
    • Haos Redro
Re: tcMod transform
« Reply #7 on: July 18, 2008, 12:07:02 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

  • Guest
Re: tcMod transform
« Reply #8 on: July 18, 2008, 03:29:32 pm »
seeeker, do please update us (actually, just me is fine too) about what the hell it does.

Bissig

  • Posts: 1309
  • Turrets: +103/-131
Re: tcMod transform
« Reply #9 on: July 18, 2008, 04:59:53 pm »
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

  • Posts: 546
  • Turrets: +70/-16
Re: tcMod transform
« Reply #10 on: July 19, 2008, 06:53:33 am »
"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