Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Reverse Quantizing, AKA - how to get a heightfield from contour lines

Hybrid View

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

    Default

    Very cool!

    Being able to generate a smooth heightfield from contours would be amazingly useful in terms of controlling where you want your mountains etc to go, how high they are and how steep.

    By 'interpolate' do you mean a gradient fill from one one colour's level to the next or is what is referred to as a 'blend' in illustrator, where you create new vector shapes that ...er..interpolate from one shape to the next. (have I answered my own question?)

    I'd like to play around with this too. If the shapes are complex, I wonder whether feathering or using an inner glow might work to blend the colours between levels?

    If we can crack this problem, then overlaying the resulting image against a faint perlian noise background would provide a nice natural 'noise' to the mountains.

  2. #2

    Default

    Interpolate actually creates new shapes between two paths and optionally interpolates the style attributes. Here is an example of interpolating between two shapes apart from each other, and of a white circle on a black square (similar to the way I did the contour interpolating).
    Click image for larger version. 

Name:	interpolate.png 
Views:	235 
Size:	33.9 KB 
ID:	1802

    Now please explain what is the 'blend' in illustrator - I don't know what it is...

    -Rob A>

  3. #3

  4. #4

    Default

    I think this is a good place to explain in more detail what I've already done about this; I've written a Python script which will interoplate between contours in a rather vanilla way. For each point not on a contour, it finds the closest points to the contours on either side and calculates the height according to the distances to these points, so if a point was halfway between the nearest points on each of the 1000 and 2000 metre contours, it would be set to 1500 metres. Points within the topmost contour line are interpolated relative to the top two contours, which seems the only sensible thing to do.

    This works well enough for a first approximation, but it lacks detail and isn't very useful for my purposes, which require a lot more realism. I tried to make the results more realistic by incorporating some plasma-generated landscaping, without much success. Ideally my program could take a quantised heightmap, interpolate in between the discrete levels, and apply some magic to generate realistic-looking mountains and so on. Any ideas?

  5. #5

  6. #6
    Guild Artisan su_liam's Avatar
    Join Date
    Aug 2007
    Location
    Port Alberta, Regina(IRL: Eugene, OR)
    Posts
    798

    Default

    Funny coincidence. I've just been working on a similar problem. I was playing around with a heightfield I found on the net(I've been looking into the possibility of stitching together real-world heightmaps and subtly altering them to produce interesting and "realistic" extraterrestrial landscapes). The heightmap had serious stairsteps so, in Bryce, I used several iterations of the smoothing, noise, erode and eroded tools to obliterate the steps(mostly), and then applied a fractal at very low opacity on top of that. Thus far my methods aren't at all systematic(just to taste) and won't necessarily maintain the original landform with great fidelity.

    Attached, I have an image generated from the original hf at upper left. From lower right clockwise: a heavily modified version(this was my second try, I lost the first one, which was my favorite ), a less modified version, and on the upper right a minimally modified version(this is about as much of the original structure as I could maintain without obvious stepping.

    I'll try to add individual closeups and heightfields later. I'll also try to work out my methodology. This really isn't interpolation(since it doesn't maintain the existing contours), it's more like draping a canvas over a frame. Only the frame can get a little whacked out of shape.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	interpolation3.jpg 
Views:	127 
Size:	1.37 MB 
ID:	1803  

  7. #7

    Default

    su_liam-

    Can you post that original heightfield (as b/w or contour lines)?

    It would be nice to have a standard example to play at with different techniques and compare the result.

    -Rob A>

  8. #8
    Guild Artisan su_liam's Avatar
    Join Date
    Aug 2007
    Location
    Port Alberta, Regina(IRL: Eugene, OR)
    Posts
    798

    Default

    Quote Originally Posted by RobA View Post
    su_liam-

    Can you post that original heightfield (as b/w or contour lines)?

    It would be nice to have a standard example to play at with different techniques and compare the result.

    -Rob A>
    They're jpeg and not my original 16-bit tiffs, but here you go...

    interpOrig.jpg is the original. Mmm, duh?
    interpHeavy.jpg is the one at lower right.
    interpModerate.jpg is the one at lower left.
    interpLight.jpg is the one at upper right.

    edit: just noticed how bryce pooped all over the original aspect ratio. Sorry 'bout that.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	interpOrig.jpg 
Views:	62 
Size:	13.8 KB 
ID:	1804   Click image for larger version. 

Name:	interpHeavy.jpg 
Views:	79 
Size:	29.6 KB 
ID:	1805   Click image for larger version. 

Name:	interpModerate.jpg 
Views:	68 
Size:	27.3 KB 
ID:	1806   Click image for larger version. 

Name:	interpLight.jpg 
Views:	63 
Size:	28.0 KB 
ID:	1807  
    Last edited by su_liam; 11-29-2007 at 02:37 PM.

  9. #9

    Default

    Quote Originally Posted by RobA View Post
    Bricka-

    How slow is it to process a large image?
    It certainly wouldn't win any awards for speed; a file of a million pixels takes a few minutes.

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

    Post

    In terms of stitching arbitrary height maps may I point you at some work done by Howard Zhou who has been working on this sort of thing for a while...

    http://terrain.cg-arts.org/forum/ind....msg821#msg821
    http://www.howardzzh.com/research/terrain/

    To keep it simple, I believe he is finding the closest path between two maps and cutting along them - a bit like photo stitching I think. I reckon there is a lot more to it tho. Its unbelievably awesome actually. Anyways there is a world machine plug in to do it.

Page 1 of 2 12 LastLast

Posting Permissions

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