Texture transformation
1 post • Page 1 of 1
Texture transformation
I need it for my scene, maybe someone needs it too:
- Code: Select all
Scene.my.tmTrans := (tm, ang, shift) => {
sin_a := math.sin(ang);
cos_a := math.cos(ang);
m1 := [[tm(0),tm(1)], [tm(3),tm(4)]];
m2 := [[cos_a, sin_a], [-sin_a, cos_a]];
mx := [[m1(0)(0)*m2(0)(0) + m1(0)(1)*m2(1)(0), m1(0)(0)*m2(0)(1) + m1(0)(1)*m2(1)(1)],
[m1(1)(0)*m2(0)(0) + m1(1)(1)*m2(1)(0), m1(1)(0)*m2(0)(1) + m1(1)(1)*m2(1)(1)]];
sx := [shift(0)*mx(0)(0) + shift(1)*mx(0)(1), shift(0)*mx(1)(0) + shift(1)*mx(1)(1)];
[mx(0)(0), mx(0)(1), tm(2)+sx(0), mx(1)(0), mx(1)(1), tm(5)+sx(1), tm(6), tm(7), tm(8)]
};
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
1 post • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests