|
|
"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
|
|
|
|
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)
|
|