[opensource-dev] converting degrees into quaternions

2012-07-31 Thread CJ Davies
I've been struggling with this for 2 days now & am no closer to working 
it out (despite investigating all sorts of examples online, including 
the SL wiki).

I have a accelerometer/magnetometer that tells me orientation via 
compass bearing, pitch & roll. All of these are in degrees which can 
easily be converted to radians via foo*DEG_TO_RAD. I want to plug these 
values into llcoordframe methods to control where the camera points. All 
of the llcoordframe stuff works in quaternions & I can't for the life of 
me convert properly.

I've just tried following this approach --> 
http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm

But this results in output like this --> http://paste2.org/p/2089138

Note how the calculated w/x/y/z values change drastically with tiny 
changes in the bearing/pitch/roll, eg between lines 43 & 50 (the 
accelerometer/magnetometer was motionless on the desk at the time!).

Any help greatly appreciated.

Regards,
CJ Davies
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges


Re: [opensource-dev] converting degrees into quaternions

2012-07-31 Thread Sophira Crystal
Hi,

You don't convert degrees to quaternions directly. You convert vectors
to rotations (which are quarternions), and you do that with the
llEuler2Rot function.

As for the rest of your query, you might find
http://wiki.secondlife.com/wiki/Rotation helpful - I don't know much
about rotations, but I bet the answer you want is probably in there
somewhere.

I hope my reply's been helpful, even though I personally don't know much...

 - Sophie.

On Tue, Jul 31, 2012 at 11:54 AM, CJ Davies  wrote:
> I've been struggling with this for 2 days now & am no closer to working
> it out (despite investigating all sorts of examples online, including
> the SL wiki).
>
> I have a accelerometer/magnetometer that tells me orientation via
> compass bearing, pitch & roll. All of these are in degrees which can
> easily be converted to radians via foo*DEG_TO_RAD. I want to plug these
> values into llcoordframe methods to control where the camera points. All
> of the llcoordframe stuff works in quaternions & I can't for the life of
> me convert properly.
>
> I've just tried following this approach -->
> http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm
>
> But this results in output like this --> http://paste2.org/p/2089138
>
> Note how the calculated w/x/y/z values change drastically with tiny
> changes in the bearing/pitch/roll, eg between lines 43 & 50 (the
> accelerometer/magnetometer was motionless on the desk at the time!).
>
> Any help greatly appreciated.
>
> Regards,
> CJ Davies
> ___
> Policies and (un)subscribe information available here:
> http://wiki.secondlife.com/wiki/OpenSource-Dev
> Please read the policies before posting to keep unmoderated posting privileges
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges


Re: [opensource-dev] converting degrees into quaternions

2012-07-31 Thread Sophira Crystal
Hi,

To follow up on this...

The easiest way to do what you want is to make a vector made up of
 in degrees, multiply the vector by DEG_TO_RAD,
and then put it through llEuler2Rot. You should then have a good
rotation that you can pass to a function that needs it.

Hope this helps!

 - Sophie.

On Tue, Jul 31, 2012 at 1:29 PM, Sophira Crystal  wrote:
> Hi,
>
> You don't convert degrees to quaternions directly. You convert vectors
> to rotations (which are quarternions), and you do that with the
> llEuler2Rot function.
>
> As for the rest of your query, you might find
> http://wiki.secondlife.com/wiki/Rotation helpful - I don't know much
> about rotations, but I bet the answer you want is probably in there
> somewhere.
>
> I hope my reply's been helpful, even though I personally don't know much...
>
>  - Sophie.
>
> On Tue, Jul 31, 2012 at 11:54 AM, CJ Davies  wrote:
>> I've been struggling with this for 2 days now & am no closer to working
>> it out (despite investigating all sorts of examples online, including
>> the SL wiki).
>>
>> I have a accelerometer/magnetometer that tells me orientation via
>> compass bearing, pitch & roll. All of these are in degrees which can
>> easily be converted to radians via foo*DEG_TO_RAD. I want to plug these
>> values into llcoordframe methods to control where the camera points. All
>> of the llcoordframe stuff works in quaternions & I can't for the life of
>> me convert properly.
>>
>> I've just tried following this approach -->
>> http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm
>>
>> But this results in output like this --> http://paste2.org/p/2089138
>>
>> Note how the calculated w/x/y/z values change drastically with tiny
>> changes in the bearing/pitch/roll, eg between lines 43 & 50 (the
>> accelerometer/magnetometer was motionless on the desk at the time!).
>>
>> Any help greatly appreciated.
>>
>> Regards,
>> CJ Davies
>> ___
>> Policies and (un)subscribe information available here:
>> http://wiki.secondlife.com/wiki/OpenSource-Dev
>> Please read the policies before posting to keep unmoderated posting 
>> privileges
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges


Re: [opensource-dev] converting degrees into quaternions

2012-07-31 Thread Nexii Malthus
Hey Folks,

The C++ codebase doesn't have much to do with LSL, so llEuler2Rot won't
exactly help.

What you are looking for CJ are the helper functions for quaternions, maybe
this one will help:

 const LLQuaternion& setEulerAngles(F32 roll, F32 pitch, F32 yaw);

(form 
llquaternion
)

- Nexii

On Tue, Jul 31, 2012 at 1:38 PM, Sophira Crystal  wrote:

> Hi,
>
> To follow up on this...
>
> The easiest way to do what you want is to make a vector made up of
>  in degrees, multiply the vector by DEG_TO_RAD,
> and then put it through llEuler2Rot. You should then have a good
> rotation that you can pass to a function that needs it.
>
> Hope this helps!
>
>  - Sophie.
>
> On Tue, Jul 31, 2012 at 1:29 PM, Sophira Crystal 
> wrote:
> > Hi,
> >
> > You don't convert degrees to quaternions directly. You convert vectors
> > to rotations (which are quarternions), and you do that with the
> > llEuler2Rot function.
> >
> > As for the rest of your query, you might find
> > http://wiki.secondlife.com/wiki/Rotation helpful - I don't know much
> > about rotations, but I bet the answer you want is probably in there
> > somewhere.
> >
> > I hope my reply's been helpful, even though I personally don't know
> much...
> >
> >  - Sophie.
> >
> > On Tue, Jul 31, 2012 at 11:54 AM, CJ Davies 
> wrote:
> >> I've been struggling with this for 2 days now & am no closer to working
> >> it out (despite investigating all sorts of examples online, including
> >> the SL wiki).
> >>
> >> I have a accelerometer/magnetometer that tells me orientation via
> >> compass bearing, pitch & roll. All of these are in degrees which can
> >> easily be converted to radians via foo*DEG_TO_RAD. I want to plug these
> >> values into llcoordframe methods to control where the camera points. All
> >> of the llcoordframe stuff works in quaternions & I can't for the life of
> >> me convert properly.
> >>
> >> I've just tried following this approach -->
> >>
> http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm
> >>
> >> But this results in output like this --> http://paste2.org/p/2089138
> >>
> >> Note how the calculated w/x/y/z values change drastically with tiny
> >> changes in the bearing/pitch/roll, eg between lines 43 & 50 (the
> >> accelerometer/magnetometer was motionless on the desk at the time!).
> >>
> >> Any help greatly appreciated.
> >>
> >> Regards,
> >> CJ Davies
> >> ___
> >> Policies and (un)subscribe information available here:
> >> http://wiki.secondlife.com/wiki/OpenSource-Dev
> >> Please read the policies before posting to keep unmoderated posting
> privileges
> ___
> Policies and (un)subscribe information available here:
> http://wiki.secondlife.com/wiki/OpenSource-Dev
> Please read the policies before posting to keep unmoderated posting
> privileges
>
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges

Re: [opensource-dev] converting degrees into quaternions

2012-07-31 Thread CJ Davies
Looks like my problem was an amateur mistake - causing integer division 
on a float value, which when dealing with values that range between -1 & 
1 is fairly debilitating!

I'm now getting the right values, but in the wrong places, using the

LLQuaternion(F32 x, F32 y, F32 z, F32 w);

constructor. I presume this must just be because whilst SL uses E/W as 
+ve/-ve x axis & N/S as +ve/-ve y axis I must be assuming something else 
for my magnetometer/accelerometer.

SL looking North - {0.0, 0.0, 0.7, 0.7}
magnetometer pointing North - {0.0, 0.0, 0.0, 1.0}

SL looking East - {0.0, 0.0, 0.0, 1.0}
magnetometer pointing North - {0.7, 0.0, 0.0, 0.7}

SL looking South - {0.0, 0.0, -0.7, 0.7}
magnetometer pointing South - {-1.0, 0.0, 0.0, 0.0}

SL looking West - {0.0, 0.0, 1.0, 0.0}
magnetometer pointing West - {-0.7, 0.0, 0.0, 0.7}

Whilst I'm at it, llquaternion.h has some confusing comments in it... 
(look at the order of parameters in declaration & comment closely!)

const LLQuaternion& setEulerAngles(F32 roll, F32 pitch, F32 yaw);   // 
Sets Quaternion to euler2quat(pitch, yaw, roll)

Regards,
CJ Davies

On 31/07/12 16:14, Nexii Malthus wrote:
> Hey Folks,
>
> The C++ codebase doesn't have much to do with LSL, so llEuler2Rot won't
> exactly help.
>
> What you are looking for CJ are the helper functions for quaternions,
> maybe this one will help:
>
>   const  LLQuaternion&  setEulerAngles(F32  roll,  F32  pitch,  F32  yaw);
>
> (form llquaternion
> )
>
> - Nexii
>
> On Tue, Jul 31, 2012 at 1:38 PM, Sophira Crystal  > wrote:
>
> Hi,
>
> To follow up on this...
>
> The easiest way to do what you want is to make a vector made up of
>  in degrees, multiply the vector by DEG_TO_RAD,
> and then put it through llEuler2Rot. You should then have a good
> rotation that you can pass to a function that needs it.
>
> Hope this helps!
>
>   - Sophie.
>
> On Tue, Jul 31, 2012 at 1:29 PM, Sophira Crystal  > wrote:
>  > Hi,
>  >
>  > You don't convert degrees to quaternions directly. You convert
> vectors
>  > to rotations (which are quarternions), and you do that with the
>  > llEuler2Rot function.
>  >
>  > As for the rest of your query, you might find
>  > http://wiki.secondlife.com/wiki/Rotation helpful - I don't know much
>  > about rotations, but I bet the answer you want is probably in there
>  > somewhere.
>  >
>  > I hope my reply's been helpful, even though I personally don't
> know much...
>  >
>  >  - Sophie.
>  >
>  > On Tue, Jul 31, 2012 at 11:54 AM, CJ Davies
> mailto:cjohndav...@gmail.com>> wrote:
>  >> I've been struggling with this for 2 days now & am no closer to
> working
>  >> it out (despite investigating all sorts of examples online,
> including
>  >> the SL wiki).
>  >>
>  >> I have a accelerometer/magnetometer that tells me orientation via
>  >> compass bearing, pitch & roll. All of these are in degrees which can
>  >> easily be converted to radians via foo*DEG_TO_RAD. I want to
> plug these
>  >> values into llcoordframe methods to control where the camera
> points. All
>  >> of the llcoordframe stuff works in quaternions & I can't for the
> life of
>  >> me convert properly.
>  >>
>  >> I've just tried following this approach -->
>  >>
> 
> http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm
>  >>
>  >> But this results in output like this --> http://paste2.org/p/2089138
>  >>
>  >> Note how the calculated w/x/y/z values change drastically with tiny
>  >> changes in the bearing/pitch/roll, eg between lines 43 & 50 (the
>  >> accelerometer/magnetometer was motionless on the desk at the time!).
>  >>
>  >> Any help greatly appreciated.
>  >>
>  >> Regards,
>  >> CJ Davies
>  >> ___
>  >> Policies and (un)subscribe information available here:
>  >> http://wiki.secondlife.com/wiki/OpenSource-Dev
>  >> Please read the policies before posting to keep unmoderated
> posting privileges
> ___
> Policies and (un)subscribe information available here:
> http://wiki.secondlife.com/wiki/OpenSource-Dev
> Please read the policies before posting to keep unmoderated posting
> privileges
>
>

___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges


Re: [opensource-dev] A rather uniquely unexpected behavior from Second Life's official viewer

2012-07-31 Thread Kadah
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I see this too sometimes. What release channel is the region?

On 7/26/2012 7:35 PM, Moriz Gupte wrote:
> Hello, I am wondering  what could be causing objects to disappear
> in the latest Second Life viewer 3.3.4.26
> 
> See picture of the same scene (1) in the SL official viewer, and
> (2) in FireStorm Inline image 1
> 
> I am wondering why the SL viewer is not rendering objects? This is
> one strange behavior  When I log back in, I can see all them
> again, regardless of whether I clear cache or not. Any clues what
> could be wrong. This is a show stopper for me because now am not
> sure what users will be seeing or not.
> 
> R
> 
> -- 'Consider how the lilies grow. They do not labor or spin.' 
> *Rameshsharma Ramloll* PhD, /Research Associate Professor/, Idaho
> State University, Pocatello, ID 83209 Tel: 208-282-5333 Blog
> , LinkedIn 
> 
> 
> 
> ___ Policies and
> (un)subscribe information available here: 
> http://wiki.secondlife.com/wiki/OpenSource-Dev Please read the
> policies before posting to keep unmoderated posting privileges
> 
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEbBAEBAgAGBQJQGIybAAoJEIdLfPRu7qE2TUEH9217nDebcXKPhVksvyZGxyiw
X17au7Z4w4oEohEjARHYEndatYm1wguvDpqaxSrbutO0oBYbPPVwJ1gF0noVAmSu
h5FoTqkiz1s9cI1MaMCTNz+rCoqzTH9rHtSsebJSO9S+gqAgohtq9gRnOUG04fBy
QMG3h1pqDfsEjbi6SIVA3OoiRz+uUS7OXzU/gn05A8OOc39vllhRoJFRCfb0YpBe
kZUH1SjtrnI/tucQ3hTPrRCoER02TOKittTAuTzUM64ij/XGVoU6w6FDJ30zOYnR
RQrHPjDcC2W8MKdCdsocruwBHNVFjGPAXaaTlyL/XZn5w7obDB0fDRkc9MXnKw==
=tugn
-END PGP SIGNATURE-
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges


Re: [opensource-dev] New HTTP Library & Project Viewer

2012-07-31 Thread Kadah
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 7/30/2012 4:13 PM, Henri Beauchamp wrote:
> Don't put word in my mouths, that I never pronounced... I was not
> speaking about *persistent* connections. The current HTTP fetches
> are not persistent connections, and that's why 32 simultaneous
> requests are not really an issue (and it was actually the limit in
> Snowglobe v1.5, thus why I kept it in the Cool VL Viewer, but made
> it configurable (and defaulting to 16), when I noticed that the v2
> viewers changed that limit down to 8 then up to 16 and then to
> whatever number it is now hardcoded with).


Its 8 again with the fallow comment. I tired to track down the rev,
but apparently Mecurial 2.2 can't properly annotate that file for some
reason, and the new UI for it in TortoiseHg2 is horrid. All of the
referenced jiras around its changes are not public.

//NOTE:
//control the number of the http requests issued for:
//1, not openning too many file descriptors at the same time;
//2, control the traffic of http so udp gets bandwidth.
//
static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 8 ;
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQGI5dAAoJEIdLfPRu7qE2HUkIAJRvKLZ9Y5MfZq4SJaCBGcOe
tPG2TPamItRvGAE554xTlo4NDv8OHb0PbLoLsH4hLLNrsqLRXVuIgqi86lWrIphK
JMp8r9ePCpDha9hlo3xw/DoUF3ZDJNvBoUgg12B1/eGSHVjviPPP7CFuQKofRtLK
p2RrgAsa4CwNdH7sXKodmzC92+fxw6DjXKXfyn4ss6MeNr+pUtKUDklxe0sBK69k
E/wvHplNfXOjBQ14cBjDINJZXxoU/D5++X8+8oe5EtvXs6jcULAuAwqhuno5v7KY
vOtFo9YNGgiipaBd4Ft+duice4Z02b2T/NtWvFy5l02YaMQ1UTdz4Fnsaap6JAw=
=nNko
-END PGP SIGNATURE-
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges