# Quaternary rotation

Please take a moment to consider if this thread is worth bumping.

## Recommended Posts

Does anyone know of a good explanation for how to set quarternary rotations for the spatially challenged?  I've been trying to set x=90, z=180 for a while to use a sculpty cushion as a poseball and I think I'm running out of both hair and spinal fluid...  help?

##### Share on other sites

A function you can use is llEuler2Rot(). There are good explanations on the old wiki.

• 1
##### Share on other sites

lordy my brain hurts - I haven't dealt with sine and cos in over 20 years...  the crap we go through to save prims *sighs*

Anyone want to write a utility that reads a rotation and tells you want it is? LOL

##### Share on other sites

I use a simple utility script when all I need is a hardcode rotation. Set a prim the way I want, drop it in, copy/paste results.

`default {   state_entry() {      llOwnerSay("Rot: " + (string)llGetRot() + " / Local Rot: " + (string)llGetLocalRot());   }}`

• 1

thank you!!

##### Share on other sites

You can do the conversion you want this way:

`rotation rot = llEuler2Rot(<90.0,0.0,180.0>*DEG_TO_RAD);`

That is, take the <x,y,z>  value in degrees, turn it into radians by multiplying by the constant DEG_TO_RAD and then tell lsl to convert that into a quaternion for you.

Void's rotation page is really useful https://wiki.secondlife.com/wiki/User:Void_Singer/Rotations﻿  and Grandma Bates has recently put up two very helpful tutorials on SLU, Basic Introduction to Rotations and Introduction to Rotations pt 2

• 1
##### Share on other sites

Siofra Alter wrote:

Does anyone know of a good explanation for how to set quarternary rotations for the spatially challenged?  I've been trying to set x=90, z=180 for a while to use a sculpty cushion as a poseball and I think I'm running out of both hair and spinal fluid...  help?

For sitting you don't need to loose your hair:smileyvery-happy:

You just pick up the free Easy SitTarget Tool at the market place

Way back I pulled out my hair trying to find correct llSitTarget parameters

That was before I learned that the function is buggy and before I learned how to work around the bugs

Discussions about the bug and it's correction:

http://forums-archive.secondlife.com/54/09/242119/1.html﻿

http://forums-archive.secondlife.com/54/6a/153963/1.html﻿