Rotating a texture using scripts
2 posts • Page 1 of 1
Rotating a texture using scripts
Hello. I've made a texture wich I need to rotate when the circle that holds the texture is hit by a laser.
Does anyone know how I would go around making this happen?
Thanks
Does anyone know how I would go around making this happen?
Thanks
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Rotating a texture using scripts
You should search better....
viewtopic.php?f=13&t=1032&p=10228&hilit=repost#p10228
Kilinich wrote:Repost from phun forum to algodoo.
Some of my "knowhow" thyme functions:
1) For dynamic textures (rotation/scaling ):
- Code: Select all
//T - original textureMatrix, T(2) and T(5) - horizontal and vertical shift
//a - rotation angle
//s - scale
scene.my.txTransform := (T, a, s) => {[math.cos(a)*s, math.sin(a)*s, T(2), - math.sin(a)*s, math.cos(a)*s, T(5), T(6), T(7), T(8)]};
//Type it in console to make test:
scene.addbox{color := [1,1,1,1]; texture := "algoryx.png"; textureMatrix := {scene.my.txTransform([1,0,1,0,1,1,0,0,1], app.mousepos(0), 2^app.mousepos(1))}}
viewtopic.php?f=13&t=1032&p=10228&hilit=repost#p10228
-

Nait - Posts: 224
- Joined: Fri Oct 30, 2009 1:56 am
- Location: Eastern Russia, Vladivostok
2 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests




