Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llGroundContour

Ardith Mifflin
Mecha Fiend
Join date: 5 Jun 2004
Posts: 1,416
11-24-2004 08:43
Can anyone provide a better (possibly graphical) explanation of what value llGroundContour returns? I understand llGroundNormal and llGroundSlope, but the contour function explanation on the Wiki just doesn't help me at all.
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
11-24-2004 09:45
Hi Ardith!

'Contour' in that context means... well, have you ever looked at a topographical map? All the lines forming the landforms on topographical map are contours; lines following areas of ground that are all at the same height.

Say you had an irregular-shaped hill, and you magically sliced it horizontally half-way up, and took the top off. If you looked down at the hill from above, the edge outline of the cut would be the contour of the land at the height of the cut.

So... llGroundContour() would return a vector that points in the direction of the contour at offset. I suppose, since contours are usually not straight, it would actually be tangent to the contour... kind of like the slope at any given point of a graphed curve.

You know... I'm not sure anything I just said made any sense at all. Did it? :D

Edit: Here is a topographical map of a glacier up here in Canada. All the wiggledly lines show continuous areas of constant height. Were you to walk along one of these lines IRL, you'd wander all over the place, but your altitude would always remain the same.
_____________________
- Making everyone's day just a little more surreal -

Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
Lance LeFay
is a Thug
Join date: 1 May 2003
Posts: 1,488
11-24-2004 10:58
I've wondered about such things myself.
_____________________
"Hoochie Hair is high on my list" - Andrew Linden
"Adorable is 'they pay me to say you are cute'" -Barnesworth Anubis
Ardith Mifflin
Mecha Fiend
Join date: 5 Jun 2004
Posts: 1,416
11-24-2004 11:32
I understand the idea of a contour map, but I'm still not understanding what the vector which the function returns actually represents. I suppose I shall just have to play around with the function when I get in-world later. I suspect that will help me better understand your explanation, Cross. Thanks. :)
Jake Cellardoor
CHM builder
Join date: 27 Mar 2003
Posts: 528
11-24-2004 22:12
llGroundContour returns an answer to the question, "from where I'm standing, what direction can I walk in and experience no change in elevation?"

One possible application: if your object is at the shoreline, this function would be useful for moving the object along the water's edge.
Carnildo Greenacre
Flight Engineer
Join date: 15 Nov 2003
Posts: 1,044
11-24-2004 23:56
But aren't there at least two such directions for any given point? Which answer does it return?
_____________________
perl -le '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_++;'
Azelda Garcia
Azelda Garcia
Join date: 3 Nov 2003
Posts: 819
11-25-2004 03:02
Well, both vectors will likely be parallel since presumably the vector is simply the cross-product of the ground-normal vector and the z-axis:

CODE

vector llGroundContour( vector pos )
{
return llGroundNormal( pos ) % (< 0,0,1> );
}


?