Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

LSL Portal Wiki accuracy

Gregory McLeod
Registered User
Join date: 21 Oct 2006
Posts: 278
09-01-2008 11:09
I am having difficulty in understanding the LSL function definitions in the LSL Portal Wiki

https://wiki.secondlife.com/wiki/LlSetLocalRot
and
https://wiki.secondlife.com/wiki/LlSetRot

The examples appear to me to be wrong.
Could someone with better knowledge of these functions care to comment?
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
09-01-2008 11:17
What is that you don't understand?

What is that you think is wrong?

I think if these were defined incorrectly someone would have noticed it by now.

Have you put the commands in a script? If so, what was the result and show us the code.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
09-01-2008 11:21
From: Gregory McLeod
I am having difficulty in understanding the LSL function definitions in the LSL Portal Wiki

https://wiki.secondlife.com/wiki/LlSetLocalRot
and
https://wiki.secondlife.com/wiki/LlSetRot

The examples appear to me to be wrong.
Could someone with better knowledge of these functions care to comment?

Do you mean the lines...?

llSetRot(llGetRot()*rot_xyzq);
llSetLocalRot(llGetRot()*rot_xyzq);

I've not bothered to try it but on first read this looks wrong to me and should be...

llSetRot(rot_xyzq * llGetRot());
llSetLocalRot(rot_xyzq * llGetLocalRot());

*edit* ...and on a second read it probably depends on what you expect the examples to do. */edit*

/esc
_____________________
http://slurl.com/secondlife/Together
Gregory McLeod
Registered User
Join date: 21 Oct 2006
Posts: 278
09-02-2008 02:41
From: SuezanneC Baskerville
What is that you don't understand?

What is that you think is wrong?

I think if these were defined incorrectly someone would have noticed it by now.

Have you put the commands in a script? If so, what was the result and show us the code.
I think the llSetLocalRot is used incorrectly, wth the wrong parameters as it takes no account of the rotation of the root prim.

It does what it says it will do but only under specific conditions.

I have and the result is unexpected to say the least.
1.Construct two cubes.
2.Flatten one to a square color the top and bottom faces to different colors to assist identification.
3.Attach the flattened square to the side of the cube at mid height.
4.Link the two prims with the cube as the root prim.
5.Insert the example script from the LSL Wiki llSetLocalRot into the flattened cube and change the movement value to 30 degrees to make it more visible.
6.Save the script.
7.Finish editing.
8.Edit the object and edit linked parts.
9.Select the flattened prim.
10.Check the rotation values in the edit panel.
11.Finish editing.
12.Touch the flattened child prim.
13.Edit the object.
14.Edit linked parts.
15.Check the rotation values in the edit panel.
16.Repeat 11 - 15 4 more times.

When I do this the rotation values go to X: 180 Y: 60 Z: 180 which I find strange.
It was not until I put an oriented texture on the faces (which did not change) that I started to realise the rotation vlaues are based on something else. So perhaps the example text is not wrong but my interpretation of the expected results is.
Thanks for forcing me to check into it more deeply.

My original problem seems to be related to the orientation of the root prim.
I was using a cylinder turned horizontal with a flat square wing one one side and when I used the llSetLocalRot example the flat wing turned on the first click to that I have just indicated. Most unexpected! So I think it needs factored in some way by the global rotation?

On your last comment there are lots of entries in the Wiki which have obviously never been completed and many contain errors of a minor nature. So accepting what is written as gospel truth is foolish in extreme. That is however the nature of a Wiki it needs tender care and nurturing.
Gregory McLeod
Registered User
Join date: 21 Oct 2006
Posts: 278
09-02-2008 02:42
From: Escort DeFarge
Do you mean the lines...?

llSetRot(llGetRot()*rot_xyzq);
llSetLocalRot(llGetRot()*rot_xyzq);

I've not bothered to try it but on first read this looks wrong to me and should be...

llSetRot(rot_xyzq * llGetRot());
llSetLocalRot(rot_xyzq * llGetLocalRot());

*edit* ...and on a second read it probably depends on what you expect the examples to do. */edit*

/esc
Thanks for your reply Escort see the above as I am finally on the track of solving this problem.
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
09-02-2008 02:56
You may want to examine http://jira.secondlife.com/browse/SVC-93.
Long-standing bug with llSetLocalRot and PRIM_ROTATION.
_____________________
Gregory McLeod
Registered User
Join date: 21 Oct 2006
Posts: 278
09-02-2008 03:40
From: Tyken Hightower
You may want to examine http://jira.secondlife.com/browse/SVC-93.
Long-standing bug with llSetLocalRot and PRIM_ROTATION.
Thanks for the reference. I have looked at that but my problem is more fundamental than that although affected by it. I have also voted for it to be fixed, in whatever way they decide, but fixed. Rotations are difficult enough without confusing the natives with bugs.