Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotating a texture

Scooter Back
Registered User
Join date: 12 Aug 2007
Posts: 32
09-16-2008 10:22
I'm trying to write a script that will rotate a texture on a prim attached to the HUD.

I know how to set the timer, the entry, and even the llDetectedRot().

But when I use the llRotateTexture I get a type mismatch. And I understand why, I am trying to use a rotation as a float.

So, how do I convert the x axis rotation into a float for use in the llRotateTexture?

What I've tried is

llRotateTexture(llDetectedRot(), ALL_SIDES):

Thanks for any help!

Scooter
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
09-16-2008 11:38
I guess you probably need to convert the rotation (quaternion) into Euler angles (XYZ), and then use the X component, like this:

CODE

vector angles = llRot2Euler(llDetectedRot(0));
llRotateTexture(angles.x, ALL_SIDES):


That's just a bit of a guess though... I'm tired and waiting on pizza and caffeine arriving so I can get in-world for a while later! :)