Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Wind direction

Selador Cellardoor
Registered User
Join date: 16 Nov 2003
Posts: 3,082
02-11-2006 17:33
It appears from a recent thread about a sailing script that wind in second life does have a direction. But all I can find is llWind, a function that returns the wind velocity at a particular point.

Is there a way of determining wind direction that I have overlooked?
_____________________
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
02-11-2006 17:36
CODE
default
{
state_entry()
{
llSetTimerEvent(1);
}
timer()
{
llSetLocalRot(llRotBetween(<1.0, 0.0, 0.0>, llWind(<0.0, 0.0, 0.0>)));
}
}
_____________________
Selador Cellardoor
Registered User
Join date: 16 Nov 2003
Posts: 3,082
02-11-2006 17:38
That's great - thank you.
_____________________
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
02-11-2006 17:38
From: Selador Cellardoor
That's great - thank you.

No problem :) .
_____________________
Sky Honey
Coder
Join date: 16 May 2005
Posts: 105
02-11-2006 20:12
From: Selador Cellardoor
It appears from a recent thread about a sailing script that wind in second life does have a direction. But all I can find is llWind, a function that returns the wind velocity at a particular point.

Is there a way of determining wind direction that I have overlooked?

Selador maybe you've already realized this from Cid's reply, but it took me way too long to understand this myself so I'll reiterate it here: a vector quantity can actually represent a speed and a direction. A velocity vector has x, y and z components that are the speed the object is moving in each of those planes. llVecNorm converts it into a unit vector, essentially removing the speed part to make the direction easier to work with. llVecMag combines the x,y and z speeds into the "net" speed of the object as a float.

If that's a crappy explanation, please someone correct it!