The Genesis Toolkit

Home

The Genesis Toolkit
 Terra

Stereo 3D

Linux

Projects

Gallery

Download

Links

Imprint

Email:
Latest update
April 24 2010 18:51:55
countercountercountercountercountercounter
Donate
































































































































































































































The Genesis Toolkit


The Genesis Toolkit is a set of executables to work with POV-Ray heightfields. All of them have to be started at the promt with a few parameters. (This can be done using a batch or script file)
At this time there are executables for Linux
and M$-Windows (for those who havn't upgraded)

My thanks to Michael Muldown who wrote a graphical user interface for the Genesis Toolkit. So if you prefer to use a GUI instead of typing all these command options, you can download it at his site:
GT - a graphical user interface for the Genesis Toolkit

October, 11 1998

  • The LINUX Version of the Genesis Toolkit is available.

  • July, 26 1998

  • Version V.1998.07.26 now available for download.
  • I made much modifications on GEN, ROUGH and HFMERGE.
  • The new tool CUTTER can cut away invisible objects out of the scene discreption file. This will save a lot of memory, parsing and render time.

  • June, 20 1998

  • The Vegetation Package was updated on June, 20 1998. There's now a more natural coniferous tree, designed by Stig Bachmann Nielsen.




  • The Genesis Tools:

  • ROUGHT
    To create a physical map of a heightfield
  • GEN
    To place objects onto the surface of a heightfield
  • CUTTER
    Cutting away all objects which are invisible for the POVRAY-camera
  • GIF2TGA / TGA2GIF
    to convert heightfield file formats
  • HFMERGE
    To merge 2 heightfields.

  • Download the genesis Toolkit

  • The Vegetation Package:

  • Sample Objects, designed for the Genesis Toolkit, including two trees, a fern and grass


  • ROUGH

    The job of ROUGH is to create a map of the heightfield. There are different types of vegetation in a landscape. On rocky areas for example there will be less vegetation than on plane areas. The vegetation is also changing at different height levels.
    ROUGH makes a map of the landscape, this map is a GIF-file and can be used as an image_map for POVRAY, or as a plantmap for GEN. Each of these area types has its own color index in the resulting GIF file.







    Options for ROUGH:

    -i   Input file (Heightfield, 24bit TGA format)
    -o  Output file name (GIF-format)
    -r   Roughtness sensibility-control for detection
    -ha Level A (percent)
    -hb Level B (percent)
    -hc Level C (percent)
    -hd Level D (percent)
    -he Level E (percent)

    EXAMPLE:
    To set the values matching to the left figure:
    ROUGH -itestland.tga -omap.gif -ha2 -hb20 -hc40 -hd60 -he80



    The -r option can be used to fine tune the roughtness detector to your requirements. The higher the value, the more vegetation will be detected.





    top of page

    GEN

    The job of GEN is to compute object positions for objects, which are to be set onto the surface of a heightfield. The output of GEN is an include file (.INC) containing all objects.
    GEN needs some informations about the heightfield:
  • The dimensions of the heightfield in the resulting POV-Ray scene (-X, -Y and -Z)
  • where to plant the objects (plantmap in .GIF format)
  • The heightfield file (24bit TGA).
    The max. input file size supported is 2000x2000 pixel.

    Options for GEN:

    -i   Input file (Heightfield, 24bit TGA format)
    -o  Output file (the .INC file to be included by the POV-Ray scenefile).
    -m specifies the plantmap file. It contains the information where to set the objects.
    -p  tells the program at which palette entry in the plantmap objects appaer.
    -s   to control the average space between each objects.
    -x   tells the program...
    -y   ...the size of the heightfield...
    -z   ...used by the POV-Ray scene.
    -d   no object below this height-value
    -u   no object above this height-value
    -rp The option -rr is used to avoid or allow random placement of the objects.
    -rp0 don't use random placement
    -rp1 use random placement

    -rr The option -rr is used to avoid or allow ramdomized rotation around the Y-axis.
    -rr0 don't use random rotation
    -rr1 use random rotation

    -rs 0 no use / 1...100 use of random scaling
    -rs0 don't use random scaling
    -rs1...100 use random scaling

    -rd random seed
    -n the name of the object to be set on the surface. Used in the outputfile.

    EXAMPLE:
    GEN.EXE -itestland.tga -otrees.inc -mplantmap.gif -x500 -y100 -z500 -p2 -s6 -d3 -r1 -no01

    The Heightfield Size

    GEN assumes that the lower left corner of the heightfield is originated at <0,0,0>.
    To know the size of the heightfield, GEN needs to know the vector for the upper right corner.
    height_field {
       tga "scene2.tga"
       scale <512, 100, 512>
       pigment{ color White }
    }
    

    The settings for the example heightfield are:

     -x512 -y100 -z512 







    back to the options






    The Plantmap

    The plantmap tells GEN where to set the objects on a height field. In this example, i took the output file of ROUGH and draw some red areas with a paintprogram (palette index 4 in the gif file).

    EXAMPLE:
    -mmap.gif -p4
    The file map.gif is used as plant map and objects are planted at palette index 4.




    Index 1
    Index 2
    Index 3
    Index 4







    Space between the objects

    The option -s is used to control the average space between the objects.
  • -s5 will let 5 POV-Ray units between each object
  • -s12 will let 12 POV-Ray units space
    The smaller the value, the more objects.
    -s5
    -s12




    Random Placement

    The option -rp is used to avoid or allow ramdomized placement of the objects.
    It is used like a flag:
  • -rp0 don't use random placement
  • -rp1 use random placement
    The option -rp does not change the amount of objects.
    -r0 no random
    -r1 random



    Random Rotation

    The option -rr is used to avoid or allow ramdomized rotation of the objects.
    It is used like a flag:
  • -rr0 don't use random rotation
  • -rr1 use random rotation

    Each object will be rotated around its Y-axis (randomly 0...360deg) before it is placed.







    The Outputfile

    The result of GEN's job is an include file for POV-Ray. It contains all objects with the current positions on the heightfield. The includefile will look like this:

    object{o01 translate<26.262139,7.031357,306.000076>}
    object{o01 translate<30.433226,3.125048,245.732643>}
    object{o01 translate<36.720893,3.515679,239.608036>}
    object{o01 translate<35.880596,5.468833,247.161550>}
    object{o01 translate<37.751442,3.906310,354.641423>}
    object{o01 translate<43.295404,3.906310,239.690802>}
     :      :      :       :        :          :
     :      :      :       :        :          :
     :      :      :       :        :          :
    object{o01 translate<468.526063,5.078202,433.829356>}
    





    CUTTER


    The idear of CUTTER is to cut away all objects which are invisible for the POVRAY camera, or which are to far away to be visible. This will decrease the total amount of objects in the final POVRAY scene and helps to save memory, parsing and render time for a scene.

    To do this CUTTER needs some informations:

  • location, direction, right and look_at vectors of the camera
    I have added a simple parser to read POVRAY camera declarations. Just name the file with the camera declaration and CUTTER will try to get all needed values.
  • Max-Distance, if you like to skip objects behind a defined distance.
  • Min-Distance, if you need objects around the camera although they are not visible. (I.e. if there's a tree behind your camera, you should see it's shadow although the tree itself is invisible)


  • Options for CUTTER are:
    -i name of the INC-file, including all objects
    -o name of the output-INC-file, the visible objects
    -p name of the POV-file, including the camera declaration
    -e max distance limit (0 no limit, 1...~ value for limit)
    -s min distance limit (0 no limit, 1...~ value for limit)

    The camera parser of CUTTER is really stupid. Every expression should be in a single row and you may not use any arithmetic expression in a vector. Comments with // are supported, those with /*...*/ not.
    I.e. this is a valid camera:

      camera {
      //   location<100,20,120>  // this comment is OK
         location<360,3.80,75>
         direction <0,0,1>
         up <0,1,0>
         right <1.3333333,0,0>
         look_at <118,20,230>
      }
    

    This one is not valid:

      camera {
         location<360-17,3.80+clock*100,75-(clock*100)>
         direction <0,0,1+1>                      /* this comment is not OK */
         up <0,1,0>
         right <1.3333333,0,0>    look_at <118,20,230>
      }
    




    GIF2TGA / TGA2GIF

    GIF2TGA converts GIF heightfields into TGA heightfields. The Usage is:

       GIF2TGA.EXE infile.gif outfile.tga
    

    TGA2GIF converts TGA heightfields into GIF heightfields. The Usage is:

       TGA2GIF.EXE -iinfile.tga -ooutfile.gif
         -i specifies the input TGA file
         -o specifies the output GIF file
    






    HFMERGE

    HFMERGE is a tool to merge two heightfields or make some manipulations. You can add two heightfields, make a subtraction, shift a heigthfield up or down, scale it, cut it at a level and so on.

    Options for HFMERGE:

    -a   name of input heightfield A
    -b   name of input heightfield B (only used for method 1...5)
    -o   name of outputfile
    -v   0...100% (only used for method 6...11)
    -m   to specify the method to be used:
    -m1 (A+B)/2
    -m2 A+B
    -m3 A-B
    -m4 max(A,B)
    -m5 min(A,B)
    -m6 A+v% (shift up)
    -m7 A-v% (shift down)
    -m8 A below v% of total height
    -m9 A above v% of total height
    -m10 scale A by v% of total height
    -m11 A + random(v%)

    When using method 1...5 make shure that both heightfields have exactly the same resolution!
    In this example below, the first heightfield is a landscape created by GFORGE. I have merged it with a mandelbrot-heightfield using method -m1.

    1.Heightfield (created with GFORGE)
    2.Heightfield (created with WinFract)
    Here is the resulting heightfield. I used ROUGH for the colormaps, to get a better impression of the shapes.






    Sample Objects

    This objects are designed to be small in memory, so that a large amount of them can be used.
    Trees, fern and grass, The Vegetation Package The trees are looking better in distance.






    Download the Genesis Toolkit





  • Joerg Schrammel - - Duisburg Germany