Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

need help with llSitTarget and sitting angles

Jahline Steed
Registered User
Join date: 15 Aug 2004
Posts: 4
03-13-2005 14:56
"llSitTarget(vector offset, rotation rot)"

I've constructed a rather nifty vehicle. The vehicle script allows stable(THAT is rare in a second life vehicle:) ) vertical feats and changing characteristics via voice commands. Finally perfected but I cannot understand the simplest thing;

I want to fine tune my avatar's sitting position on the vehicle. I understand the first argument, "LLSitTarget(<X,Y,Z> ...." Where you simply position your avatar along the XYZ axis from the datum.

The second argument, "llSitTarget(<X,Y,Z>, <A,B,C,D>;)" confuses me. The abcd bit. The scripting manual seems to skim over this. By trial and error, abcd seem to be toggles (0 and 1) which inverts your avatar on certain axis. I would have thought that you could use ABCD to rotate your avatar on relevant axis , hence "rotation rot".

What I really need to do is rotate my avatar's sitting position on the vehicle so that the driver will sit back at an angle. Reclined. Lets say make the driver recline 30 degrees back, instead of bolt upright.

I would be very grateful if somebody could provide me with a quick example of how to make an avatar sit on the vehicle at an angle!
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
03-13-2005 15:35
'hokay, so. First of all, rotations in Second Life are listed as these wonderful things called ternions, which are a subset of quaternions. Don't open either link unless you've some aspirin handy and a spare computer monitor after you break the first with a hammer.

The brief explanation of them, though, is pretty simple. Rotations in Second Life are listed, as you said, <A,B,C,D>. However, the easier representation is <X,Y,Z,S>. X,Y, and Z are obvious. S is just a rotation about the axis formed by all three.

Still not simple to use, though. The easiest method I know is this:

CODE
vector rot = <180,0,0>; // Rotation in degrees

rotation actual_rot = llEuler2Rot(PI / 180 * rot);

llSitTarget(add_vector_here, actual_rot);
_____________________
---
Jahline Steed
Registered User
Join date: 15 Aug 2004
Posts: 4
03-13-2005 21:02
worked thanks!
Buster Peel
Spat the dummy.
Join date: 7 Feb 2005
Posts: 1,242
03-19-2005 10:29
From: Jeffrey Gomez
'hokay, so. First of all, rotations in Second Life are listed as these wonderful things called ternions, which are a subset of quaternions. Don't open either link unless you've some aspirin handy and a spare computer monitor after you break the first with a hammer.


<clicks on link>



<falls over dead>
Danny DeGroot
Sub-legendary
Join date: 7 Jul 2004
Posts: 191
03-19-2005 14:10
Well, I don't know what's wrong with everybody else, but I opened the first link, and absorbed the paper's introductory concepts at a single glance.

Well, except for the hollow circle between the parentheses, and the fancy-shmantzy capital "N".

Oh, and the lowercase "q" with the matching little thingies on each side.

== danny d.