TextureMatrix tutorial anyone?

About advanced scenes, and the Thyme scripting language used in Algodoo.

TextureMatrix tutorial anyone?

Postby Dare » Thu Oct 07, 2010 8:05 am

Does anyone know where I can find a good tutorial on how to manipulate textureMatrixes? It would be much appreciated.
ImageImage
TC42 wrote:Dare, you are creepy.

Official Algobox Admin! Please PM me if you have any issues regarding Algobox.
User avatar
Dare
 
Posts: 833
Joined: Sat Nov 21, 2009 4:27 pm
Location: Sydney, Australia

Re: TextureMatrix tutorial anyone?

Postby Kilinich » Thu Oct 07, 2010 2:00 pm

Original post by skydiver:

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...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: TextureMatrix tutorial anyone?

Postby Dare » Thu Oct 07, 2010 3:49 pm

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.
ImageImage
TC42 wrote:Dare, you are creepy.

Official Algobox Admin! Please PM me if you have any issues regarding Algobox.
User avatar
Dare
 
Posts: 833
Joined: Sat Nov 21, 2009 4:27 pm
Location: Sydney, Australia

Re: TextureMatrix tutorial anyone?

Postby Kilinich » Thu Oct 07, 2010 6:27 pm

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
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: TextureMatrix tutorial anyone?

Postby Dare » Fri Oct 08, 2010 2:03 am

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.
ImageImage
TC42 wrote:Dare, you are creepy.

Official Algobox Admin! Please PM me if you have any issues regarding Algobox.
User avatar
Dare
 
Posts: 833
Joined: Sat Nov 21, 2009 4:27 pm
Location: Sydney, Australia

Re: TextureMatrix tutorial anyone?

Postby Nait » Sat Apr 13, 2013 9:42 am

What are last three values used for?
User avatar
Nait
 
Posts: 224
Joined: Fri Oct 30, 2009 1:56 am
Location: Eastern Russia, Vladivostok

Re: TextureMatrix tutorial anyone?

Postby jon_joy_1999 » Sun Apr 14, 2013 1:14 am

Nait wrote:What are last three values used for?

sanity
Image
BSrac = BoincStats recent average credit
I'd rather be network computing.
jon_joy_1999
 
Posts: 233
Joined: Fri Dec 09, 2011 12:51 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest