Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Getting rotation

Allan Beltran
Registered User
Join date: 2 Dec 2006
Posts: 52
03-09-2007 21:36
I'm using llTargetOmega() to get a smooth swinging rotation of an object. However, I need to check the current rotation periodically, but llGetRot(), llGetLocalRot, and llGetRootRotation() all return the same rotation; and it's not correct.
CODE

rotation my_rot = llGetRot();
llSetText("rot_x: " + (string)my_rot.x + "\n" +
"rot_y: " + (string)my_rot.y + "\n" +
"rot_z: " + (string)my_rot.z + "\n", <255,255,255>,1)


returns something like...<0.707010,0.00,0.00> for all three functions.

After reading further, llTargetOmega() is a client side rotation. But does that mean that I cannot get the actuall rotation that I currently see?

Another oddity is that when I minimize the client and then return, the object is sometimes rotated way off. In other words, think of a swing, "hanging" at a 45 degree angle.
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
03-09-2007 21:47
From: Allan Beltran

After reading further, llTargetOmega() is a client side rotation. But does that mean that I cannot get the actuall rotation that I currently see?


bingo, each client sees the rotation in a different position, and the sim is totally clueless, its basicly a graphic effect
Allan Beltran
Registered User
Join date: 2 Dec 2006
Posts: 52
03-09-2007 22:04
From: Osgeld Barmy
bingo, each client sees the rotation in a different position, and the sim is totally clueless, its basicly a graphic effect

Bummer.

My goal has been to make a sign that swings in the breeze. I've had some decent results, seen here...http://slurl.com/secondlife/Monema/208/152

But the odd behavior is annoying. If I could get the rotation that the client sees, then that'd be most helpful.

Right now, I have it resetting the script every 15 seconds, but that seems to not work after a few cycles.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
03-10-2007 10:00
Instead of trying to measure the rotation, you could try calculating it, by checking the time since llTargetOmega was called (since timer and sleep durations aren't quite reliable, depending on server load) and multiplying by the rotation rate. Though this would be very hit-and-miss for something that's constantly running, since it would vary significantly from one viewer to the next, as the rotation from their POV would have started when it entered their draw distance, rather than when the server issued the command.

[Edit to add]
Hey, what about a flexi prim with 0 smoothness?
Allan Beltran
Registered User
Join date: 2 Dec 2006
Posts: 52
03-11-2007 08:59
From: Deanna Trollop
Instead of trying to measure the rotation, you could try calculating it, by checking the time since llTargetOmega was called (since timer and sleep durations aren't quite reliable, depending on server load) and multiplying by the rotation rate. Though this would be very hit-and-miss for something that's constantly running, since it would vary significantly from one viewer to the next, as the rotation from their POV would have started when it entered their draw distance, rather than when the server issued the command.

[Edit to add]
Hey, what about a flexi prim with 0 smoothness?
I thought of doing somehting like that; but like you said, it's hit and miss.

Not much experience with flexi prims...