TextureMatrix tutorial anyone?
7 posts • Page 1 of 1
TextureMatrix tutorial anyone?
Does anyone know where I can find a good tutorial on how to manipulate textureMatrixes? It would be much appreciated.
-

Dare - Posts: 833
- Joined: Sat Nov 21, 2009 4:27 pm
- Location: Sydney, Australia
Re: TextureMatrix tutorial anyone?
Original post by skydiver:
http://www.phunland.com/forum/viewtopic.php?id=7628
Look the transformation matrix:
a b c
d e f
g h i
The object's property textureMatrix is [a, b, c, d, e, f, g, h, i].
The transformation matrix (2x2) is only:
a b
d e
To rotate by Q degrees (radians) the transformation matrix is:
cos Q sin Q
-sinQ cos Q
(you know: a = cos Q, b = sin Q, etc)
To scale by a factor of (sx,sy), the transformation matrix is:
sx 0
0 sy
To mix both rotation and translation, we multiply the two matrixes:
sx cos Q sy sin Q
-sx sin Q sy cos Q
The final matrix is then: [sx cos Q, sy sin Q, 0.5, -sx sin Q, sy cos Q, 0.5, 0, 0, 1]
http://www.phunland.com/forum/viewtopic.php?id=7628
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
Re: TextureMatrix tutorial anyone?
I suppose most of that makes sense. I understand trigonometry (sin, cos, tan), but have no idea how to put it into action in scripting. All I am looking for is a nice tutorial on how to make specific matrixes, e.g. dynamic rotor blades. Anyway, thanks for the help.
-

Dare - Posts: 833
- Joined: Sat Nov 21, 2009 4:27 pm
- Location: Sydney, Australia
Re: TextureMatrix tutorial anyone?
Maybe this help a bit too http://en.wikipedia.org/wiki/Transformation_matrix
If you want to do something with textureMatrix you must multiply it to transformation matrix.
I think you better start with learning what matrix is
and what is basic operations.
http://en.wikipedia.org/wiki/Matrix_%28math%29
If you want to do something with textureMatrix you must multiply it to transformation matrix.
I think you better start with learning what matrix is
http://en.wikipedia.org/wiki/Matrix_%28math%29
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
Re: TextureMatrix tutorial anyone?
Maybe when I do linear algebra in maths ... right now I am doing year 10 work, and there is nothing about linear algebra in my work. However, I am moving into physics in science, so they might give us a run-down on matrixes.
At least now I know how complex they are. They are probably too difficult for me at the moment.
At least now I know how complex they are. They are probably too difficult for me at the moment.
-

Dare - Posts: 833
- Joined: Sat Nov 21, 2009 4:27 pm
- Location: Sydney, Australia
Re: TextureMatrix tutorial anyone?
What are last three values used for?
-

Nait - Posts: 224
- Joined: Fri Oct 30, 2009 1:56 am
- Location: Eastern Russia, Vladivostok
Re: TextureMatrix tutorial anyone?
Nait wrote:What are last three values used for?
sanity
- jon_joy_1999
- Posts: 233
- Joined: Fri Dec 09, 2011 12:51 am
7 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest





