Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

ANOTHER question about rotation

Cherry Hainsworth
Registered User
Join date: 31 Jul 2006
Posts: 125
12-30-2007 17:58
Before I start asking for more help on this mysterious (mystical?!) topic, I have something to offer: this cool little degrees/eulers - to - radians/quaternion converter. It runs on Java and is donation ware :)

His RGB slider is nice, too:
http://www.geocities.com/mak2000sw/

One day, I might learn what to do with the converter! :rolleyes:

I made a reversible rug. I added a script so the owner can flip it over (I know I could just switch the texture, but that's not the point!). My problem, of course, is that I don't know how to predict - and compensate for - the angle at which the rug will 'land' when it's flipped.

I want it to end up in the exact inverse of its touch_start position (only the Z axis having changed, by 180 deg). Is there a formula I can implement to set this? (And what is it??)

Thanks!
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-30-2007 18:39
you can try
rotation vRotCurrent = llGetRot();
vRotCurrent.s *= -1;
llSetRot( vRotCurrent );

but I think it'd be easier to pick and axis to rotate around locally and rotate that 180 like
llSetRot( llEuler2Rot( <PI, 0, 0> ) * llGetRot() );

that'd flip around the x axis, you could change that to a differnt one.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Cherry Hainsworth
Registered User
Join date: 31 Jul 2006
Posts: 125
12-30-2007 18:56
From: Void Singer

......

but I think it'd be easier to pick and axis to rotate around locally and rotate that 180 like
llSetRot( llEuler2Rot( <PI, 0, 0> ) * llGetRot() );

that'd flip around the x axis, you could change that to a differnt one.

VOID, YOU'RE A GENIUS!!

Thanks, it works like a charm :))

Happy New year!
Cherry :)
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
12-30-2007 20:04
It might be cool to set the rug to flexi, and then flip it over in several steps, and then turn flexi off again. Maybe it would be all flappy and waviy while it turns over.
8-)
_____________________
So many monkeys, so little Shakespeare.
Cherry Hainsworth
Registered User
Join date: 31 Jul 2006
Posts: 125
12-30-2007 20:28
From: Lee Ponzu
It might be cool to set the rug to flexi, and then flip it over in several steps, and then turn flexi off again. Maybe it would be all flappy and waviy while it turns over.
8-)

Ha, you're as batty as me! :D
I did play around with that but - while amusing myself hugely - it didn't look much like a rug being turned over. I added a couple of position shuffles after Void's perfect turn, just for effect though.

Maybe we should team up on a line of flexi-rotatable prims & get an animator to create a duvet-stuffing routine for couples (or is SL already too much like RL)?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-31-2007 08:35
createinjg a believable flexi rug turn would take 2 prims joined at the axis, and making sure they only had drag & stiffness setnot much drag either... I'd say 4, but you can't cut the damn things (a person hated of mine, ruined a spectacular project)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -