|
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
|
02-15-2007 07:40
Hello people,
I've read quite a bit about aligning. In general I do the calculations and hope to get precision that way. But - what about aligning with ground level? I rez a prim, and I'm never sure how to get it grounded. Sometimes I use the grid and hope my object will snap to ground level, but it does'nt seem a wholly reliable way. Anyone know anything better?
Thanks, Xylo
|
|
Warda Kawabata
Amityville Horror
Join date: 4 Nov 2005
Posts: 1,300
|
02-16-2007 00:32
When you rez a default 0.5m cube on the groun, the base is automatically touching the ground exactly at the point centred vertically on that cube. Given that most land isn't exactly flat, you can't really force it to be level with every point of ground.
My usual approach is to make the foundation prims of any building very deep, and bury the building's foundations into the ground.
|
|
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
|
02-16-2007 02:54
You can get the info for aligning stuff with the ground with a script using these: llGround()and llGroundNormal() or llGroundSlope()
|
|
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
|
02-16-2007 05:21
Thanks a lot, Warda. AJ: I'm afraid that succinct description was way over the head of this newbie...I know one can put a script into an object, in the Contents tab, and that is as far as my knowledge goes.
Xylo
|
|
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
|
02-16-2007 05:24
From: Xylo Quisling Thanks a lot, Warda. AJ: I'm afraid that succinct description was way over the head of this newbie...I know one can put a script into an object, in the Contents tab, and that is as far as my knowledge goes.
Xylo Soz, should have considered my audience better. I'm about to go out right now, I'll write you up a quick script or two when I get a second.
|
|
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
|
02-19-2007 17:25
This will tell you the height, angle and normal of the ground under a prim's centre when you touch it: default { touch_start(integer total_number) { llOwnerSay("Ground height: "+(string)llGround(ZERO_VECTOR)); llOwnerSay("Ground angle: "+(string)llGroundSlope(ZERO_VECTOR)); llOwnerSay("Ground normal: "+(string)llGroundNormal(ZERO_VECTOR)); } } Afraid I don't know how to convert the angle/normal to rotations that can be used in a prim's settings right now (maybe a maths bod somewhere can help?) but here's a script that'll put an un-rotated, un-dimpled prim on the ground when you touch it: default { touch_start(integer total_number) { vector myPos=llGetPos(); vector mySize=llGetScale(); float sitHeight=llGround(ZERO_VECTOR)+(mySize.z/2); llSetPos(<myPos.x,myPos.y,sitHeight>); } }
|
|
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
|
Thanks
03-06-2007 07:57
Drat, hadn't seen your reply before, AJ. Thanks so much for your trouble,
Xylo
|