POV-Ray : Newsgroups : povray.general : Improving POV-Ray. : Re: Improving POV-Ray. Server Time
12 Aug 2024 19:39:18 EDT (-0400)
  Re: Improving POV-Ray.  
From: Ken
Date: 19 Feb 1999 12:34:16
Message: <36CDA02F.F777BCF3@pacbell.net>
Robert J Becraft wrote:
> 
> This I GOT.  This works fine if you want to reiteratively place objects on your
> scene.  It does not provide me any means of ascertaining the height on the
> heightfield for individually placed items.
> 
> A simple scattering loop looks like this:
> 
> #declare R1=seed(3838)
> #declare Count=1
> #while (Count<100)
>     #declare X=rand(R1)*100
>     #declare Z=rand(R1)*100
>     #declare Y=somefunction(HFNAME, X,Z,100,100)
>     object{TheTHING translate<X,Y,Z>}
>     #declare Count=Count+1
> #end
> 
> This does a random scatter of 100 items across an area bounded 0,0,0 to 100,?,100
> where "somefunction" delivers the Y coordinate.
> 
> Schrammel's toolkit is wonderful but very complicated to setup and use for the
> kind of work I want to do with POV.  The above example would work fine with his
> tool since it only uses 1 item named "TheTHING" ... however, my "TheTHING" becomes
> an entire case statement where "TheTHING" can be any of a hundred items (depending
> on what I'm rendering, this can be more or less).
> 
> In order to use the utility, EACH and every item in the 100 items would have to
> have the program run 1ce for each item.  Then all the output files combined to
> render it.  If any of the items collided, I couldn't just change the seed R1 value
> to resolve them, I'd have to regenerate EVERY one of the include files generated
> and hope that they didn't collide again.
> 
> Bob Hughes wrote:
> 
> > Genesis Toolkit by Schrammel can do this. Check here:
> >
> > http://www.rhein-ruhr.de/~schrammel/index.htm
> >

  If it's just random distributed points (locations for "TheTHING" )
on a terrain then you are looking, for Ray Gardeners program Leveller,
has this function available. It allows you to choose some variables of
the process, such as % per grid point or % of the entire HF and number
of points to generate, and then will export these point coordinates in
an array of 3d coordinates. You then use the array in a while a loop to
translate your choosen "TheTHING" to their respective locations. 
   Since the program knows where each elevation point is along the grid
it's output gives very accuarate placement of "TheTHING" or group of
"TheTHINGS". There is also an option at the time of the export where
it will provide a sample Pov script for the proper use of the while
loop in conjunction with the array to "TheTHING" to their final matching
positions along the topography of the height field.
  The export points feature is a somewhat limit function in that is is not
constrained to a selectable area rather it is ditributed across the entire
grid based upon the percentages you choose in the setup fields. The only
constraing option that I am aware of is you may choose an elevation cutoff
point that works much the same as the water level does in Pov. This way
you will have "TheTHING" restricted to points that are higher than that
elevation you choose as the demarcation line.
  There are other tools in the program that make it possible to measure
a point on the field but I wouldn't try this for more than a hand full
of objects since as far as I know you would have to copy the information
down and use it later when you set up your scene file. It would be tedious
with many objects invoved, but also may prove invaluable for placing a
couple of buildings on a hill, or a string of fence posts up a slope,
that other wise would take way too much trail and error to get
positioned right otherwise.

Leveller may be found at: http://www.daylongraphics.com/

His ISP is giving him problems with access right now due to equipment
changes. If it shows up missing or inactive try back in a couple days
and it should be there.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

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