Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Texture moves wrong with wheel rotation

Layla Honi
Registered User
Join date: 1 Nov 2007
Posts: 171
11-25-2008 21:53
I ran into a problem with a texture rotation scipe. It is a wheel rotation script. It worked fine with the tire texture I was using. A friend made a new tire texture for me. After aligning it and testing it on my bike, instead of only rotating the correct way it is shifting horizontally about 90° so the treads are on the sides of the tire.
Here is the wheelRot script I am using. I also tried it with another wheel rotation script and it did the same thing.

CODE

default
{
state_entry()
{
llSetTimerEvent(0.20);
}
timer()
{
vector vel = llGetVel();
float speed = llVecMag(vel);
if(speed > 0)
{
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, 0, 0, 0, 0, 1, speed*0.5);
}
else
{
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP | REVERSE, 0, 0, 0, 0, 1, speed*0.5);
}
}
}
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
11-25-2008 22:54
From: Layla Honi
After aligning it

That's likely your problem right there. If by "aligning it", you mean you had to adjust the repeat, rotation, and/or offset settings in the editor, then that's where you went wrong. The script will override any parameter settings you put into the editor. The texture has to fit properly with all settings at zero, or else the animation won't work.

It sounds to me like your best bet is to rotate the texture 90 degrees in an image editing program (or ask your friend to do it, since he/she made it).