Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

A texture rotation from notecard.

Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
03-05-2008 17:35
I have to ask.

How do I get a rotation in degrees, i.e. rot1=45 ( a line in the notecard)

I need to convert 45 degrees (rot1) in the script so it rotates a texture.

float rot1;

command() {llSetPrimitiveParams([PRIM_TEXTURE, side1, tex1, reps1, offs1, rot1,PRIM_COLOR, side1, col1, a1]); return; }

if ("rot1" == item) { rot1 = (float )value;return; }

some incarnations I have tried.

// rotation rot1a = rot1 * DEG_TO_RAD);
// Rotation, in degrees.
//vector rot1 = <0, 0, 0>;
//vector rot1 = DEG_TO_RAD;
//float radians = (rot1 * DEG_TO_RAD);
// Convert degrees to radians.
//(float)(( rot1) * DEG_TO_RAD)
//rot1 = ;

I get errors about syntax with the multiplyer * all the time although all the examples I look at have the multiplyer. Otherwise I have to keep putting 1.59609blah into the notecard. Customers don't like this.

This has taken a very long time for me and I just don't get it.

Another question:
I get a prim rotating with llTargetOmega(). It says in wiki that as a child prim it will rotate around local axis. (Say an angled prop on an airplane). But once linked, it does not seem to do that. Should I be using another function or do you mix the rotations somehow?
Thanks, I only ask as a LAST resort as I just can't get these to work.
Jerry Martin
Registered User
Join date: 2 Oct 2005
Posts: 33
03-05-2008 18:20
Try the link below , it has an example that might get you rolling.

This is for degrees
http://rpgstats.com/wiki/index.php?title=Rotation

For textures try this.

http://rpgstats.com/wiki/index.php?title=LlSetPrimitiveParams

llSetPrimitiveParams([ PRIM_TEXTURE, 0, "66864f3c-e095-d9c8-058d-d6575e6ed1b8", <2,8,0>, <.5,.5,0>, PI / 4]);

Most props are rotated not by rotating a prim prop it self but by rotating a texture of the prop . Next time you see a plane or chopper turn on view transparent and you will see it.
Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
03-06-2008 14:11
Thanks Jerry.


Math is my 2nd worst subject after running a business.

This was also posted today about rotating things.
/54/9b/244491/1.html