|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating Landscapes with Leveller and PovRay
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
First create your height field using the various tools available in Leveller. This landscape was created using the painting tools - raise for the hills and dig for the valley
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Next export your heightfield to Povray. It is a good idea to include the Camera, light and backgound info.
You will then need to export height data for the points in your heightfield. Make sure you have an area of the map highlighted and click on Export scene then Settings. Choose suitable dimensions - I use 0.1@100% for 64x64 heightfields and larger settings for bigger heightfields. It depends on what you want to put in your picture, grass requires lots of points, rocks and trees fewer. It helps to export the points with PovRay sample usage code. At least while you are learning.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
I export a different set of points for each different set of objects in the scene, this in the end, saves memory and allows you to precisely choose those areas you wish to use. You can use the render preview to see what you have selected and by careful selection save on the size of your exported file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Here's the first render - the basic landscape.
#include "colors.inc"
#version unofficial MegaPov 0.4;
#declare Image_Length = 640;
#declare Image_Height = 480;
camera
{
location <-109.000, 5.000, -76.000>
direction 1.5*z
right Image_Length/Image_Height*x
look_at <-65, -0.1, 0.9>
}
light_source { <-109.000, 500, -750.0> rgb 1.25 }
height_field
{
tga
"TutLChf.tga"
smooth
pigment {
gradient y
color_map {
[ 0.000 rgb<0,1,0> ]
[ 1.000 rgb<1,.7,.3> ]
} // color_map
} // pigment
translate <-.5, -0.081, -.5>
scale <255.000, 22.325, 255.000>
}
background { color <0.500, 0.500, 1.000> }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Now you can start adding objects to your landscape. First some Rocks!!!
// A bunch of 0.5 radius spheres are drawn at each point.
#include"TutLSpts.inc" //include all the points
#declare N = 0;
#while(N < HF_pts)
sphere {< 0, 0, 0 > 0.5 pigment {Red}
translate HF_pts_array[N]}
#declare N = N + 1;
#end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Now we'll add some trees
#include"TutLShfpts2.inc"
#declare N = 0;
#while(N < tHF_pts)
cone { y*0, 1.0,y*3,0 pigment { Yellow }
translate tHF_pts_array[N] }
#declare N = N + 20;
#end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Finally we'll add some randomness.
#declare R = seed(346);
#include"TutLSpts.inc"
#declare N = 0;
#while(N < HF_pts)
sphere {< 0, 0, 0 > 0.5 pigment {Red}
translate HF_pts_array[N]}
#declare N = N + 1*(rand(R)*10);
#end
//--------------------------------------------------------------
#include"TutLShfpts2.inc"
#declare N = 0;
#while(N < tHF_pts)
cone { y*0, 1.0,y*(1+rand(R)*5),0 pigment {Yellow}
translate tHF_pts_array[N] }
#declare N = N + 40*(rand(R)*10);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
There are other ways of achieving the same results. The trace function in the superpatch and in Megapov is very powerful and flexible but it is (for me anyway) difficult to select areas of the heightfirld with precision. The same problem exists with the "hf_height_at function in Megapov. I have used vegetate.inc which uses the trace function to populate a heightfield with objects but again it is difficult to select areas of the heightfield. All these methods do have one advantage they are free.
Leveller may not be free but it is a very powerful tool for the creation and manipulation of heightfields and not that expensive. You can find about it at: http://www.daylongraphics.com
There is also a more advanced tutorial on their site at: http://www.daylongraphics.com/products/leveller/tut/forest/index.htm
Have Fun
Mick
|
|
|
|
|
|
|
|