These forums are CLOSED. Please visit the new forums HERE
What is the resolution of llSetRot()? |
|
|
AnnMarie Otoole
Addicted scripter
Join date: 6 Jan 2007
Posts: 162
|
07-24-2007 00:03
Am I doing something wrong? Despite using float values with all the precision in the world I can only get a rotational positioning to about the nearst 6 degrees. How do I set an object to points in between?
|
|
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
|
07-24-2007 00:43
The resolution may be dependant on the conversion from Quaternion to Euler and back again.
I remember reading somewhere that a call to llSetRot would take the quaternion and convert it to Euler to set the rotation of the object which is then stored in Quaternion (makes no sense to me, I hope to be corrected). _____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum |
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
07-24-2007 01:39
Although there are bounds on the precision both of the FP representation and of any conversions or calculations the script uses, it should take a fortnight of calculations to accumulate a 6 degree error range. Something else must be happening, but to figure out what, probably need to see a bit of code.
|
|
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
|
07-24-2007 08:50
Good call Qie.
As Qie mentioned it could be something in the script, how about posting the script or any parts associated with the llSetRot and maths for the values passed to it. I won't get a chance to get in-world to experiment with the function for a while. _____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum |
|
AnnMarie Otoole
Addicted scripter
Join date: 6 Jan 2007
Posts: 162
|
07-24-2007 09:04
OK here is a simplified code extracted from the script that will demonstrate the 6 degree limit on display resolution.
OR YOU CAN SEE IT ALREADY SET UP AT http://slurl.com/secondlife/Whanganui/226/232/39 Make a dummy object and lengthen the y direction so you can see rotation angle. Insert the script, save and touch. The program is set to use 50 rotation increments of PI/100 for a total of PI/2. However the llSetRot()s have no effect until about 6 degrees are accumulated and then the object moves. I'm sure the internal resolution is good but the display is going to the nearst 6 degree (approx) increment. CODE
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
07-24-2007 09:31
Actually, the problem is not floating point errors, but a limitation in the viewer.
Any rotation less than ~6 degrees does not generate an update to be sent to the viewer. The object DOES get rotated in the sim, but viewers won't get updated until the rotation exceeds the update threshold. |
|
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
|
07-25-2007 02:00
Sadly, yes. I suppose that's to cut down on lag so it's a good thing! If you have the object selected in Edit while it's turning you can see that it's indeed turning the smaller increments.
In Edit I see it turning 1.8 degrees per step, which is correct, 90 / 50 = 1.8 |
|
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
|
07-25-2007 02:49
As Talarus says.
I recently had a similar situation with a head-turning script on a model giraffe! See this extract from the llSetRot() Wiki page at http://wiki.secondlife.com/wiki/LlSetRot For small rotations, there is an update threshold of ~6 degrees, under which the sim will not send an update for the object to the viewer, though the object will be correctly rotated in the sim. You can change some other aspect of the object (like color, for instance), and it will force an update, however |