POV-Ray : Newsgroups : povray.general : Chris Colefax's city generator : Re: Chris Colefax's city generator Server Time
2 Nov 2024 17:18:26 EDT (-0400)
  Re: Chris Colefax's city generator  
From: Chris Colefax
Date: 1 Jan 2004 19:39:31
Message: <3ff4bdc3@news.povray.org>
"Greg M. Johnson" <gregj;-)565### [at] aolcom> wrote:
> If Chris is reading these ng's,  I have a public request for a feature to
> this generator.  One thing I noticed that when tinkering years ago was
that
> the city block near the origin is completely different depending on
whether
> you have one block or mulitple blocks on the scene.   Suppose I wanted to
> set up some "action"  and do lots of tinkering at the origin block.  Then
> for final render I might want to add a bloomin' city behind it.  How hard
> would it be (for you/me) to change your city generator to make this
change?

The City Generator uses a number of random number streams to control
different aspects of the city.  One way to achieve what you want is to reset
the necessary streams for each block, e.g. create a custom city macro file
(a copy of City.mcr) and rewrite the city_building macro something like
this:

#macro city_building (Corner1, Corner2, Direction)
    #declare _CT_rand3 = seed(vlength(Corner1*100));
    #declare _CT_rand4 = seed(vlength(Corner1*100));
    #local BCentre = (Corner1 + Corner2)/2;
    #local BHeight = min_building_height +
rand(_CT_rand3)*(max_building_height - min_building_height);
    #if (BHeight > 0) city_assemble_building
(int(building_types*rand(_CT_rand3)), (Corner2-Corner1) +
y*BHeight, -y*90*Direction, BCentre + y*pavement_height) #end
#end

This way the characteristics of each building will be determined by its
distance from the origin, and adding further city blocks around the centre
will not change the existing buildings.


Post a reply to this message

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