home *** CD-ROM | disk | FTP | other *** search
/ Freelog 34 / Freelog034.iso / Graphisme3D / City / ARCTIC.POV next >
Encoding:
Text File  |  1999-02-01  |  1.9 KB  |  47 lines

  1. // CITY GENERATOR: ARCTIC VILLAGE SCENE
  2. // This scene shows how custom city generation macros can be defined
  3. // and used to create all manner of objects arranged in city formation.
  4.  
  5. // CAMERA AND LIGHTING
  6.    camera {location <-10, 30, -100> look_at <0, 0, 0>}
  7.    light_source {<-400, 200, 400> rgb 1
  8.       area_light x * 50, y * 50, 5, 5 adaptive 0}
  9.    light_source {<200, 100, -500> rgb <.1, .2, .3> shadowless}
  10.    fog {fog_type 1 color rgb <.8, .9, 1> distance 500}
  11.  
  12. // CITY TEXTURES, OBJECTS, AND MACROS
  13.    #declare R1 = seed(0);
  14.    #declare BrickSlope = slope_map {[0 <0, 1>] [.05 <1, 0>] [.95 <1, 0>] [1 <0, -1>]}
  15.    #declare Mortar1 = normal {gradient y bump_size 1 slope_map {BrickSlope} scale .5}
  16.    #declare Mortar2 = normal {radial bump_size 1 slope_map {BrickSlope} frequency 15}
  17.    #declare IceBricks = texture {
  18.       pigment {wrinkles color_map {
  19.          [0 rgb 1] [1 rgb <.9, .95, 1>]}}
  20.       normal {gradient y normal_map {
  21.         [.05 Mortar1] [.1 Mortar2] [.4 Mortar2] [.45 Mortar1] [.55 Mortar1]
  22.         [.6 Mortar2 rotate y*12] [.9 Mortar2 rotate y*12] [.95 Mortar1]}}
  23.       finish {phong .1 phong_size 5 ambient <.4, .5, .6> diffuse .5}
  24.       scale 2.5}
  25.  
  26.    #declare Igloo = union {
  27.       sphere {0, 10 texture {IceBricks}}
  28.       difference {cylinder {0, x * 15, 6} cylinder {0, x * 16, 4}
  29.          texture {IceBricks rotate z * 90}}
  30.       clipped_by {box {<-10.1, 0, -10.1>, <15.1, 10.1, 10.1>}}}
  31.  
  32.    #macro city_base (C1, C2)
  33.       plane {y, 0
  34.          pigment {rgb 1}
  35.          normal {wrinkles .5 scale 100}
  36.          finish {phong .1 phong_size 5 ambient <.4, .5, .6> diffuse .5}}
  37.    #end
  38.  
  39.    #macro city_building (C1, C2, D)
  40.       object {Igloo
  41.          scale (1 + (rand(R1)-.5) * .2) * building_width * .35 / 10 
  42.          rotate y * rand(R1) * 360
  43.          translate (C1+C2)/2 + (<rand(R1), .5, rand(R1)>-.5) * building_width * .3}
  44.    #end
  45.  
  46.    #include "CITY"
  47.