ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
vb terrain edit (Sdk)
vb terrain edit // SdkbaronDec 5, 2002, 4:17am
If the post was removed from your local cache you'll have to reset the NG headers. Right click on the SDK NG/Properties/Local file/Reset, this will force OE to download headers again. You can also set OE to not remove old posts, Tools/Options/Maintenance/Uncheck the Delete news messages checkbox. Anyway I believe the post you are looking for is news://news.activeworlds.com/Xns92C6BD43B50A9kahatkahnewsdotcjbdo at 64.94.241.201
-Baron [View Quote] technozeusDec 9, 2002, 6:16am
In case that is the one, here is the section of code from it... streamlined a bit, but functionally equivilent.
Public Sub GenerateRandom() PrevHeight = 0 For i = -50 To 50 For j = -50 To 50 HeightDifference = Int((251) * Rnd + 0) RandomNum = Int((200) * Rnd + 1) If RandomNum <= 100 Then sdk.aw_terrain_heights(0) = PrevHeight + HeightDifference Else sdk.aw_terrain_heights(0) = PrevHeight - HeightDifference End If sdk.aw_terrain_set i, j, 1, 0 Next j Next i End Sub Note: I didn't write this code, or for that matter even check to see if it works. I just copied and edited it. TechnoZeus [View Quote] kahDec 10, 2002, 4:41pm
"technozeus" <TechnoZeus at techie.com> wrote in
news:3df45146$1 at server1.Activeworlds.com: > In case that is the one, here is the section of code from it... > streamlined a bit, but functionally equivilent. ><<snipped code>> > Note: I didn't write this code, or for that matter even check to see > if it works. I just copied and edited it. I don't really recommend using it in it's current form, real uneffective (as you'll discover if you run it). KAH technozeusDec 10, 2002, 8:42pm
That's kind of what I figured too when I looked at it. I thought about making a few changes to improve the smoothness or make it more "realistic" but decided to leave it alone since it should be easy to follow in this simple form. I stripped out some code that I felt would only make it harder to follow and not serve any direct purpose. I also thought about removing the PrevHeight variable since it has no effect with a value of zero, but decided to leave it there since the "average" terrain height can be set by changing it's value.
TechnoZeus [View Quote] |