Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Tank Treads

SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
08-06-2009 13:28
I'm looking to make some tank treads rotate. I plan on doing this by animating the texture by key-press. I have the difficult task of figuring out how to make all the textures spin properly on each piece of the track so that it looks like the tread is one continuous piece. If someone could point me in the right direction I would greatly appreciate it. I have some simple animated texture scripts like waterfalls and things of this nature but nothing that deals with animation dependent on keystrokes.
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
08-06-2009 15:16
Well I'm on what seems to be the right track. I have a script that sits in the root prim and tells the tank which way to move. It also sends out a message to the tread pieces and the listener script tells the texture to move according to the button pressed. I'm having difficulty understanding the direction of the texture. I would like to know how to change the direction of the tread texture it is currently going perpendicular to the way it should be traveling. I see that with the animation script I have it will only slide it in the x direction. How do I change the direction the texture is traveling in.
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
08-06-2009 15:32
you need to rotate the texture 90 degrees in the texture tab in the edit window, you may need to rotate it in an outside imaging program and re-upload so it looks right when moving
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
08-06-2009 16:08
That's not going to work if I rotate the texture then it will look silly. Are you basically telling me I have to rotate the object and then scale it into position so that its orientated (then rotate the texture 90 degrees) so that the texture will look correct sliding along the x axis? if that's the case that's just plain dumb. I should be able to tell the texture I want it to slide along the y axis. When I build a new block the default texture should be a directional texture so I can tell what way the objects orientation is before I start building. Now I basically have to rebuild the damn tread. Sometimes SL really gets under my skin.
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
08-06-2009 16:50
which texture animation are you using? you said waterfall, so i assume you're using anim smooth, what kind of prim are you applying it to? anim smooth moves along the texture's positive x-axis, no matter what direction it's rotated, IE:

you have a texture that looks like this

| |

when sliding it'll look like this

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

but if you rotate it 90 degrees, it'll move like this

_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_

still along the texture's x axis, but along a different axis on the prim
rotating it 90 will make it move down the prim, 180 will make it move in the opposite direction, -90, or 270 will make it move up the prim
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
08-06-2009 16:56
this is the script i used to make my sign continue to slide around a cylinder, no rotations on the texture, and setting the x and y sizes to 0 makes lets you keep the same number of repeats you apply in the edit window, but that seems to mess up sometimes which is why i have it reset every 5 minutes, so it always looks the same


CODE

default
{
state_entry()
{
llSetTimerEvent(300.00);
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,0,0,1.0, 1,0.25);
}

timer()
{
llResetScript();
}
}
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
08-07-2009 05:48
this is the code I'm using for the animation of the texture. Is there another way to animate a texture so that I can tell the object I only want the texture to travel in the y or z direction.

default
{
state_entry()
{
llSetTextureAnim (ANIM_ON | SMOOTH | LOOP, ALL_SIDES, 1, 1,1,1,1);
}
}
Vance Adder
Registered User
Join date: 29 Jan 2009
Posts: 402
08-07-2009 07:13
From: SirFency Blackheart
Now I basically have to rebuild the damn tread. Sometimes SL really gets under my skin.


Without knowing all the details... I would think the only thing you need to do is pull your texture into an outside graphics app and rotate it 90 degrees.
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
08-07-2009 07:17
It don't matter which way the texture is rotated. its sliding in the wrong direction.
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
08-07-2009 07:41
OK I have the texture going in the correct direction now. It was like I stated earlier. I had to rotate the object so it was in the correct orientation. Then I had to rotate the texture so that it looked correct going down the tread. Now the texture don't obey the placement values. it seems like the only thing that's resizing the texture is by changing the code. When I change the first one in the bit of code here is scales the texture. but it wont take a float value. I need it to be less than one. As of now the texture is stretched across to much area.

default
{
state_entry()
{
llSetTextureAnim (ANIM_ON | SMOOTH | LOOP, ALL_SIDES, 1, 1,1,1,1);
}
}