POV-Ray : Newsgroups : povray.general : Landscape macros. Server Time
14 Nov 2024 23:19:36 EST (-0500)
  Landscape macros. (Message 1 to 2 of 2)  
From: Spider
Subject: Landscape macros.
Date: 8 Apr 1999 11:06:03
Message: <370CB7DB.2D61D48@hbg.lth.se>
Hello folks. 
I'm typing thisin school, so please post replies in the newsgroup, since
I'm not sure if I can reply to any mails..

I thought it was time to bring you up-to-date on the landscape
generation macros I've been working with. This way,I can get feedback,
ideas and suggestions.

There are a set of macros done now,and I'm almost ready for a 1.0
release.

Here are a macro listing(May not be correct names,but, however)

When first including the file, it needs a variable N declared. this is
the amount of points to be stored in each direction (X and Y,this is 2D)
This is the only global variable you need to bother with, and it will be
undeclared immediately after setup in the file.

Macros..

#noise(fNoiselevel)
This macro will initzialize the world, and must be called before
anything else. the float is a variable from 0..1, that is how much noise
to be added.
Noise is only random changes, adding some realism to the world.

Now we have a world initzialised.

#change_lin(vPos,fMax)
This adds a linear change to the world. It affects all positions in the
world. The fMax decides two things:
	1) positive or negative change(hill or hole)
	2) Therate of the change. 
This should be between -1 and 1 

#change_log(vPos,fMax)
This adds a logarithmic change, using a formula I found gave acceptable
results. This only affects a part of the world,and can be used for
smaller hills and such.

(I'm thinking of adding more change_ macros,but theese go for now.)

#finalize()
Will change the final values to the specified range,MUST be called
before an output, but can be called at any time. (To make some parts of
the landscape less inflicitve than others)

#out_mesh()
Will produce a triangle mesh, and will uninit the worlds data.

#out_boxes(tWhite, tBlack)
Will produce a (union) checker like world, with the textures defined.

#point(vPos)
will return the height at the position. (useful for placing trees,
cameras and so on.)

Please note that every position vector is in the range of 0..1. This
way,it won't change anything if you change the resolution.

#write_boxes(sFilename,tBlack,tWhite)
Will write the box union to the file sFilename for including later.
*WARNING*
any N>50 and povray for windows crashes with Stack Overflow.
this is a bug. 

#write_mesh(sFilename)
Writes the mesh. I am uncertain if it will crash the program or not.

More nifty info...
The output will be between <0,0,0> and <1,0..1,1>
The highest point will always be 1.

Do you have any more ideas???
(I just came up with a better way for the linear change procedure,but it
will not affect you)

I am concerned with the low epsilon values in winpov,but can't find a
way to change this. I guess I could work in 10000 range instead, but
that will increase parse time..

I haven't yet made a smooth triangle output,since I haven't yet
understood how to do it.

well,out..

//Spider


Post a reply to this message

From: Spider
Subject: Re: Landscape macros.
Date: 20 Apr 1999 12:47:44
Message: <371C7C5E.531AC598@bahnhof.se>
Updated. see povray.text.scene-files.


-- 
//Spider
        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
What I can do and what I could do, I just don't know anymore
                "Marian"
        By: "Sisters Of Mercy"


Post a reply to this message

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