POV-Ray : Newsgroups : povray.advanced-users : Crafting a heightfield Server Time
23 Nov 2024 07:39:35 EST (-0500)
  Crafting a heightfield (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Bald Eagle
Subject: Crafting a heightfield
Date: 26 Nov 2018 22:05:01
Message: <web.5bfcb3737f70c61c765e06870@news.povray.org>
I've mostly used images and data-converted-to-images to make heightfields, but
I've been toying with a scene where I'd like to make a heightfield with certain
specific attributes.

I have an island, with loosely-specified dimensions.
It has a port, and roads, and buildings, and other "flat" regions.
The topology of the land mass ought to match the location of these features.


Are there tools that are especially suited to this task?
Hoping the usual suspects who create landscape scenes can recommend a solution
and work-flow.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Crafting a heightfield
Date: 27 Nov 2018 02:33:43
Message: <5bfcf357$1@news.povray.org>
On 27-11-2018 4:01, Bald Eagle wrote:
> I've mostly used images and data-converted-to-images to make heightfields, but
> I've been toying with a scene where I'd like to make a heightfield with certain
> specific attributes.
> 
> I have an island, with loosely-specified dimensions.
> It has a port, and roads, and buildings, and other "flat" regions.
> The topology of the land mass ought to match the location of these features.
> 
> 
> Are there tools that are especially suited to this task?
> Hoping the usual suspects who create landscape scenes can recommend a solution
> and work-flow.
> 
>

Why is everybody staring at me? I am quite innocent! :-)

Give me a couple of days so that I can assess what I try to do and do not.

-- 
Thomas


Post a reply to this message

From: Bald Eagle
Subject: Re: Crafting a heightfield
Date: 27 Nov 2018 08:10:02
Message: <web.5bfd41bcde2ccc44765e06870@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:

> Why is everybody staring at me? I am quite innocent! :-)


"You there!  Yes, you - the shifty looking one trying to escape notice."


> Give me a couple of days so that I can assess what I try to do and do not.
>
> --
> Thomas

Sure, that sounds great.  :)
I think there are a lot of methods and work-flow "tricks" that are hard to come
by - and there are SO many areas in POV-Ray that have that sort of learning
curve / time investment.

And it's comparatively easy to throw some random stuff around and make it look
good vs coding up the SDL to do something within very specific parameters.
I think Archimedes was quoted as saying something about "art" vs math &
geometry.  (I have not been able to rediscover the exact quote)

Most of what I like about POV-Ray is that it blends the art and geometry, and
the deveopers and community give us one a good set of tools to bridge the two
approaches.

Thanks, Thomas  :)
All the best.


Post a reply to this message

From: Leroy
Subject: Re: Crafting a heightfield
Date: 27 Nov 2018 13:35:01
Message: <web.5bfd8e0ade2ccc4497a9bb10@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> I've mostly used images and data-converted-to-images to make heightfields, but
> I've been toying with a scene where I'd like to make a heightfield with certain
> specific attributes.
>
> I have an island, with loosely-specified dimensions.
> It has a port, and roads, and buildings, and other "flat" regions.
> The topology of the land mass ought to match the location of these features.
>
>
> Are there tools that are especially suited to this task?
> Hoping the usual suspects who create landscape scenes can recommend a solution
> and work-flow.

I got want you want! Well maybe. A long while back I was playing with height
fields and try as I may it was just to hard to make a good landscape with roads
and hills just where I wanted them. So... I wrote a series of window programs to
do the trick.(or tricks)
 The first one was base on a contour map idea. You draw a bunch of contour lines
and the program make a tga image by filling those lines. That'll let you place
roads, hill, lakes just where you want.
 The second program took that tga and let you do thing to it. Like roughing it
up, smoothing things out, flattening areas.
 The last program was made to put stuff on the height field made with your final
tga image. It started out just just to put stuff ON the height field.(trees,
bridges, houses...)  It grew so that you could put things above also. It lets
you select 16 different arrays to store locations. So I use an array to put
trees ,weeds then another to make a fly over path.
 I don't use them much an more. I haven't used height fields lately. Right now
I'm making log cabins.

All three are at my 'new' web site   https://leroyspovstuff.yolasite.com/

Hope this helps!
Have fun!


Post a reply to this message

From: Bald Eagle
Subject: Re: Crafting a heightfield
Date: 27 Nov 2018 17:10:00
Message: <web.5bfdc07bde2ccc44765e06870@news.povray.org>
(The link to MapperFix is broken)

"Leroy" <whe### [at] gmailcom> wrote:

> I got want you want! Well maybe. A long while back I was playing with height
> fields and try as I may it was just to hard to make a good landscape with roads
> and hills just where I wanted them. So... I wrote a series of window programs to
> do the trick.(or tricks)

Well - of course you did.   :D
You've got quite the collection of stuff over there!

With your new site, you should put up a few galleries of renders - you must have
a mammoth collection after all these years!


> Right now
> I'm making log cabins.

Nice  :)
You might get some ideas from the IsoWood macros.
http://www.imagico.de/iso_wood.php

> All three are at my 'new' web site   https://leroyspovstuff.yolasite.com/


Excellent - that looks like something great to try.
I was thinking I'd have to do something ridiculous with a spreadsheet or a whole
lot of trace() macros or something.

The link to MapperFix is broken - maybe the zip file doesn't have the same name
as the link that points to it?


Post a reply to this message

From: Thomas de Groot
Subject: Re: Crafting a heightfield
Date: 28 Nov 2018 03:03:55
Message: <5bfe4beb$1@news.povray.org>
On 27-11-2018 19:33, Leroy wrote:
> 
> All three are at my 'new' web site   https://leroyspovstuff.yolasite.com/
> 

Of course! I do have those macros for years, and never tried them... <shame>

-- 
Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: Crafting a heightfield
Date: 28 Nov 2018 07:24:11
Message: <5bfe88eb@news.povray.org>
On 27-11-2018 14:08, Bald Eagle wrote:
> Sure, that sounds great.  :)
> I think there are a lot of methods and work-flow "tricks" that are hard to come
> by - and there are SO many areas in POV-Ray that have that sort of learning
> curve / time investment.
> 
> And it's comparatively easy to throw some random stuff around and make it look
> good vs coding up the SDL to do something within very specific parameters.
> I think Archimedes was quoted as saying something about "art" vs math &
> geometry.  (I have not been able to rediscover the exact quote)
> 
> Most of what I like about POV-Ray is that it blends the art and geometry, and
> the deveopers and community give us one a good set of tools to bridge the two
> approaches.
> 
> Thanks, Thomas  :)
> All the best.
> 

This is a bit more tricky than I thought initially. I generally build my 
height_fields using an external program, usually the now ancient 
GeoControl (flavoured if necessary by pinches of e.g. TerraBrush, 
Wilbur, World Machine (1)) and rendered as an image_map function. That 
said, I sometimes draw the landscape beforehand in e.g. The Gimp, as a 
grey-scale contour map. I did this for instance for the Gancaloon 
project. However, I then pass this map through GeoControl in order to 
smooth out the steps between grey values (2). This is close to what 
Leroy is doing with his macros and the advantage is a fair control over 
where the topographic features need to be.

To place buildings and such where I want on the obtained height_field, I 
follow a process that is also closely related to Leroy's methodology: I 
create a /square/ map from the height_field with the orthographic 
camera. To the height_field I generally add the origin axis (at the 
centre of the height_field, ideally) and -optionally - a regular grid 
(adding no_shadow). Typically, the camera code looks like this:

//start code
camera {
   #local CamLoc    = <0.0, HF_scale.x/2, 0.0>;
   #local CamLookAt = <0.0,   0.0, 0.0>;
   orthographic
   location  CamLoc
   look_at   CamLookAt
   angle     90
   right     x*AspectRatio
}
//end code

where HF_scale is the size of the height_field, generally large, like 
8000 x 8000, and AspectRatio being image_width/image_height of course.

You now have a map on which you can determine the coordinates of your 
buildings, using e.g. The Gimp. However, you need to do a little 
calculation to convert the Gimp coordinates (origin at bottom left) to 
the POV-Ray coordinates (origin at the centre of the height_field). I 
use the following macro:

//start code
//Macro to transform a GIMP location on an orthographic map (origin 
lower left corner)
//to a POV height_field location (origin at centre of map).
//An offset (x- and z directions) needs to be determined experimentally
//as there seems to be a small discrepancy between the two map renders.

#macro LocTrans(Input)
   #local HFS      = HF_scale.x;  //assuming x = z
   #local Mdim     = MapDim; //number of pixels (assuming x = z) of the 
orthographic map view
   #local InTrans  = (100*Input)/Mdim;  //percentages from origin
   #local OutTrans = (HFS*InTrans)/100; //location on scaled height_field
   #declare Output = <-(HFS/2)+OutTrans.x, Input.y, (HFS/2)-OutTrans.z>; 
//location according to origin

   Output
   //#debug concat("\n  InTrans: <",vstr(3, InTrans, ", ", 0,3),">\n")
   //#debug concat("  OutTrans: <",vstr(3, OutTrans, ", ", 0,3),">\n")
   //#debug concat("  Output: <",vstr(3, Output, ", ", 0,3),">\n")
#end
//end code

You may need to determine offset values for x and z experimentally as 
the accuracy is not 100% in most cases. The y direction is of course 
found using trace().

Another use for the map is to draw areas where you want specific 
groupings of things, like trees. This can be done adding layers to the 
map in The Gimp and painting coloured fields over the map. In POV-Ray 
you can populate those areas on the height_field using the evalpigment 
macro.

If you use a program like GeoControl, maps with a road pattern obtained 
from the preceding action can be added to make them slightly eroded into 
the landscape or to add a particular road texture.

(1) Possibly already known locations, but:
https://www.world-creator.com/ (successor of GeoControl)
http://www.cyberfunks.de/page/terrabrush/index.htm
http://www.fracterra.com/wilbur.html
http://www.world-machine.com/index.php

(2) The drawback of the method is that it is difficult to add 
close-fitting extra height_fields to the boundaries, especially if the 
grey-scale map is passed through the sieve of another application. That 
happened to my Gancaloon landscape when I wanted to extend it. When 
under water, boundary differences are obviously unimportant, but on land...

I get the impression this is about all. If I remember additional tricks, 
I shall come back here. As an afterthought, I attach a document I wrote 
on the Gancaloon matter back in 2012.

All the above is open to further improvements. If this inspires others 
to more and better implementations I shall be very interested to hear 
from them.

-- 
Thomas


Post a reply to this message


Attachments:
Download 'guidelines for city builders.pdf' (921 KB)

From: green
Subject: Re: Crafting a heightfield
Date: 28 Nov 2018 07:35:01
Message: <web.5bfe8b49de2ccc4488dbe9e30@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> (The link to MapperFix is broken)
snip
> The link to MapperFix is broken - maybe the zip file doesn't have the same name
> as the link that points to it?

link as provided,
  https://leroyspovstuff.yolasite.com/resource/WinZips/MapperFix.zip
is missing an 's' at the end of 'resource'.  after appending it downloads ok.


Post a reply to this message

From: Bald Eagle
Subject: Re: Crafting a heightfield
Date: 28 Nov 2018 17:30:00
Message: <web.5bff1657de2ccc44765e06870@news.povray.org>
"green" <rov### [at] gmailcom> wrote:

> link as provided,
>   https://leroyspovstuff.yolasite.com/resource/WinZips/MapperFix.zip
> is missing an 's' at the end of 'resource'.  after appending it downloads ok.

Ah, thanks!  :)


Post a reply to this message

From: Leroy
Subject: Re: Crafting a heightfield
Date: 29 Nov 2018 14:00:04
Message: <web.5c00361cde2ccc44b7862ab50@news.povray.org>
"green" <rov### [at] gmailcom> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > (The link to MapperFix is broken)
> snip
> > The link to MapperFix is broken - maybe the zip file doesn't have the same name
> > as the link that points to it?
>
> link as provided,
>   https://leroyspovstuff.yolasite.com/resource/WinZips/MapperFix.zip
> is missing an 's' at the end of 'resource'.  after appending it downloads ok.

For the life of me I don't how that 's' was lost. I went to the site and got
into  the code and IT is there. I downloaded all 3 mapping programs as a test.
Gremlins....


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.