Page 3 of 3 FirstFirst 123
Results 21 to 30 of 36

Thread: Working on a ambitious world generating tool...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default

    The original heightmap (without black lines) is attached in the first message of the thread...

    Here is the code I'm using:
    actualX and actualY are the starting point coordinates. W is the width and h is the height or the image. Sealevel is... well... guess what!
    Code:
        actual = (GetPixel(picMap.hdc, actualX, actualY) And &HFF)
        Do
            used = False
            modX = 0
            modY = 0
            dif = 255
            min = 255
            For i = -1 To 1
                For j = -1 To 1
                    used = ((GetPixel(picMap.hdc, actualX + i, actualY + j) And &HFF) = 0)
                    If actualX + i > 0 And actualY + j > 0 And actualX + i < w And actualY + j < h And Not used Then
                        testValue = (GetPixel(picMap.hdc, actualX + i, actualY + j) And &HFF)
                        dif = actual - testValue
                        If dif >= 0 And dif <= min Then
                            If i = 0 And j = 0 Then
                            Else
                                min = dif
                                modX = i
                                modY = j
                            End If
                        End If
                    End If
                Next
            Next
            actualX = actualX + modX
            actualY = actualY + modY
            actual = (GetPixel(picMap.hdc, actualX, actualY) And &HFF)
            Call SetPixel(picMap.hdc, actualX, actualY, 0)
            picMap.Refresh
        Loop Until (modX = 0 And modY = 0) Or (actual < seaLevel) Or actualX < 0 Or actualY < 0 Or actualX > w Or actualY > h
    Last edited by covatex; 11-24-2008 at 03:12 PM.

  2. #2
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,201
    Blog Entries
    8

    Post

    Sorry didnt spot that. I took the height field that you posted and your color and made a 3D view. Also, I took the output from the river run and put that on top for reference. If you like these images then you can have the app - its a freebie.

    Anyway - here's some pics. I guess Nick will have to verify if you have the right method.

  3. #3
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,201
    Blog Entries
    8

    Post

    I did some more tests using my GTS to see if it could predict the river flow but it struggled with this height map too. The first image is what its like if I set it like soft mud and let it erode wildly. It cuts deep channels into it because of the large drops in height.

    Trying again with lower erosion and also adding what I call frost erosion in that when the gradient gets too high it smooths out steep cliffs then it drops out those spikes and also does a better job with the erosion. I was having fun so I rendered it with some textures too. I really like the result - looks like a waterfall type scene. Anyway - either of the two images get some basic similarities in the water flow so there's some general / vague consensus here about where the water might go. Its still a sim tho - its all guesswork.

  4. #4

    Post

    Off Topic
    Redrobes, I've downloaded ViewingDale. I put the Height.bmp and Color.bmp, but only see grayscales... What's happening?

  5. #5
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,201
    Blog Entries
    8

    Post

    Don't know ! Can you resize or make the dimensions of the images 512x512 each ? And it might be helpful if using full color images though its not supposed to matter. Other than that you might have an older type of graphics card or a driver issue.

  6. #6

    Default

    I have read what you all have wrote..

    I am at work on break right now..

    I will respond in full once I get home tonight...

    What a bummer if this doesnt work...

    Thanks
    Terry

  7. #7

    Default

    Redrobes: it looks like it could host a scene in Fantastica from The Neverending Story.

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •