Difference between revisions of "User:TdG"

From POV-Wiki
Jump to navigation Jump to search
m
m
 
(8 intermediate revisions by the same user not shown)
Line 169: Line 169:
 
'''comment''': Updated to POV-Ray 3.8, added warp turbulence, and changed to macro access by TdG (2023).
 
'''comment''': Updated to POV-Ray 3.8, added warp turbulence, and changed to macro access by TdG (2023).
  
'''code''': The following code should be saved in an include file, like crushedvelvet.inc
+
'''code''': The following code should be saved in an include file, like <code>crushedvelvet.inc</code>
  
  
Line 627: Line 627:
 
'''comment''':  
 
'''comment''':  
  
'''code''': The following code should be saved in an include file, like ewood.inc
+
'''code''': The following code should be saved in an include file, like <code>ewood.inc</code>
  
  
Line 702: Line 702:
 
<p>Using the same number for both values will produce the same building every time. If you want the buildings to look different, be sure to use different numbers. In the example scene provided, this has been addressed.</p>
 
<p>Using the same number for both values will produce the same building every time. If you want the buildings to look different, be sure to use different numbers. In the example scene provided, this has been addressed.</p>
  
'''code''': The following code should be saved in an include file,
+
'''code''': The following code files are provided. First <code>Sci-FiGenTex.inc</code>
  
 +
<syntaxhighlight lang="pov">
 +
//name to use for this include file:
 +
//Sci-FiGenTex.inc
 +
 +
#declare DWindow =
 +
  texture{
 +
    pigment {
 +
      color rgb <0.572549019607843,1,0.552941176470588> filter  .1
 +
    }
 +
    finish{
 +
      specular .1
 +
      roughness 0.00286312
 +
      ambient rgb .2
 +
      diffuse 0.6 
 +
      reflection{.5 metallic}
 +
      conserve_energy
 +
    }
 +
  }
 +
 +
#declare DHull =
 +
  texture{
 +
    pigment {color rgb .2 transmit  0}
 +
    //normal {bumps .2}
 +
    finish{
 +
      specular .1 metallic
 +
      roughness 0.286312
 +
      ambient rgb <0,0,0>
 +
      diffuse 0.7 
 +
      reflection{.0 metallic}
 +
      conserve_energy
 +
    }
 +
  }
 +
 +
#declare Bex1 =
 +
texture {
 +
  pigment { rgb <.7,.7,1> }
 +
  normal {bumps .1}
 +
  finish {
 +
    ambient .4
 +
    specular .5 metallic roughness .001
 +
    reflection .0 metallic conserve_energy
 +
    irid {0.25 thickness .5 turbulence .5}
 +
  }
 +
}
 +
 +
#declare AmWindow =
 +
  texture {
 +
    bumps
 +
    //scale .25*y
 +
    texture_map {
 +
      [0.0 Bex1]
 +
      [0.7 Bex1]
 +
      [0.7 DHull]
 +
      [1.0 DHull]
 +
    }
 +
    //scale .1
 +
  }
 +
 +
#declare Mix1 =
 +
texture {
 +
  gradient y
 +
  //scale .1*y
 +
  texture_map {
 +
    [0.0 DHull]
 +
    [0.9 DHull]
 +
    [0.9 AmWindow]
 +
    [1.0 AmWindow]
 +
  }
 +
}
 +
   
 +
#declare Mix2 =
 +
texture {
 +
  gradient y
 +
  //scale .1*y
 +
  texture_map {
 +
    [0.0 DHull]
 +
    [0.3 DHull]
 +
    [0.3 AmWindow]
 +
    [1.0 AmWindow]
 +
  }
 +
}
 +
 +
#declare Mix =
 +
texture {
 +
  bumps
 +
  scale .05
 +
  texture_map {
 +
    [0.0 Mix1]
 +
    [0.8 Mix1]
 +
    [0.8 Mix2]
 +
    [1.0 Mix2]
 +
  }
 +
  //scale <100,40,100>
 +
}
 +
   
 +
//=====================================================================
 +
 +
#declare Tex1 =
 +
texture {
 +
  pigment {rgb .3}
 +
  //normal {bumps .1 turbulence .3 scale .01}
 +
  finish {ambient 0}
 +
}
 +
 +
#declare Tex2 =
 +
texture { Mix
 +
  //pigment {rgb .2}
 +
  //finish {specular 1 metallic reflection .2 metallic}
 +
}
 +
 +
#declare Tex3 =
 +
texture { DHull
 +
  //pigment {rgb <.6,.6,1>}
 +
 
 +
}
 +
 +
#declare Tex4 =
 +
texture {
 +
  pigment {rgb .2}
 +
  finish {specular .1 reflection .00 ambient 0}
 +
}
 +
 +
 +
#declare Test =
 +
texture {
 +
// pattern for use in texture/pigment/normal/density
 +
// takes the color of an image file to calculate the pattern value
 +
  image_pattern {
 +
    jpeg "Deline05.jpg"  // image file to read (iff/tga/gif/png/jpeg/tiff/sys)
 +
    //use_color        // use pixel color gray scale (default)
 +
    //use_alpha        // use alpha value
 +
    //use_index        // use palette index 
 +
  }
 +
  scale <1/3,3/1,1>
 +
  warp {repeat y flip y}
 +
  texture_map {
 +
    [0.0  Tex1]
 +
    [0.25  Tex3]
 +
    [0.75  Tex4]
 +
    [1.0  Tex2]
 +
  }
 +
  warp {cylindrical}
 +
}
 +
</syntaxhighlight>
 +
 +
<p>Second <code>Sci-FiGen.inc</code>:
  
 
<syntaxhighlight lang="pov">
 
<syntaxhighlight lang="pov">
 +
//name to use for this include file:
 +
//Sci-FiGen.inc
 +
 +
#include "colors.inc"
 +
#include "Sci-FiGenTex.inc"
 +
 +
// sets the default texture that objects get when they have no texture specified
 +
#default {
 +
  texture {
 +
    pigment {color rgb 1}
 +
    finish{
 +
      ambient 0.0
 +
      specular .0
 +
      diffuse 0.2
 +
    }
 +
  }
 +
}
 +
 +
//###################################################################################################################
 +
//########################################## Texture Generators #####################################################
 +
//###################################################################################################################
 +
 +
#macro BfTex(d)
 +
 +
  #local R2 = seed(d);
 +
 +
 +
  #declare Tex1 =
 +
  texture {
 +
    pigment {rgb .1+rand(R2)*.3}
 +
    //normal {bumps .1 turbulence .3 scale .01}
 +
    finish {ambient 0 diffuse .3+rand(R2)*.5  specular rand(R2)*.3 metallic}
 +
  }
 +
 
 +
 +
  #declare Tex4 =
 +
  texture {
 +
    pigment {rgb .1+rand(R2)*.3}
 +
    finish {specular rand(R2)*.3 metallic reflection .00 ambient 0  diffuse (.3+rand(R2)*.5)}
 +
  }
 +
 +
#end
 +
 +
#macro BTex(d,Rot)
 +
 +
  #local R2 = seed(d);
 +
 
 +
  //BfTex(d)
 +
 
 +
  texture {
 +
    image_pattern {
 +
      #switch (int(rand(R2)*6))
 +
        #case (0)  jpeg "Deline.jpg" #break
 +
        #case (1)  jpeg "Deline02.jpg" #break
 +
        #case (2)  jpeg "Deline03.jpg" #break
 +
        #case (3)  jpeg "Deline04.jpg" #break
 +
        #case (4)  jpeg "Deline05.jpg" #break
 +
        #case (5)  jpeg "Deline.jpg" #break
 +
        #else      jpeg "Deline.jpg"
 +
      #end
 +
    }
 +
    scale <1/Rot, 3, 1>
 +
    warp {repeat y flip y}
 +
    texture_map {
 +
      [0.0  Tex1]
 +
      [0.25  Tex3]
 +
      [0.75  Tex4]
 +
      [1.0  Tex2]
 +
    }
 +
    warp {cylindrical}
 +
  }
 +
#end
 +
 +
 +
#declare DomeTex =
 +
texture {
 +
    pigment {rgb 1 transmit .9}
 +
    finish{
 +
      reflection .5
 +
      metallic
 +
      irid{.25 thickness .5}
 +
    }
 +
 +
}
 +
 +
//###################################################################################################################
 +
//########################################## Geometry Generators ####################################################
 +
//###################################################################################################################
 +
 +
//!!!!!!!!!!!!!!!!!!!!!!!!! DOME !!!!!!!!!!!!!!
 +
#macro Dome(Sz)
 +
  difference {
 +
    sphere {
 +
      0,Sz
 +
    }
 +
    plane {y,0}
 +
    sphere {0,Sz-.15}
 +
 
 +
    scale <1, (.25+rand(R1)), 1>
 +
   
 +
  }
 +
#end 
 +
 +
//!!!!!!!!!!!!!!!!!!!!!!!!! BRACE !!!!!!!!!!!!!!
 +
#macro Brace (d,DDog,BDog) //Random Seed, Controls thickness of brace, Controls angle of brace
 +
difference {
 +
  lathe {
 +
    quadratic_spline
 +
    7
 +
    <1.75,-100>,
 +
    <1.75,-50>,
 +
    <1.75,-25>,
 +
    <1.75,-20>,
 +
    <1.75,-10>,
 +
    <1.75,  0>,
 +
    <1, 4>
 +
    //<0,  5>
 +
    sturm
 +
  }
 +
  //#local DDog = rand(RX)*.4;
 +
  sphere {0*y,1.5+DDog}
 +
  cylinder {0*y,-110*y,1.5+DDog}
 +
  plane {x,-1}
 +
  plane {x, 1 inverse}
 +
  plane {z,0}
 +
  translate -4*y
 +
  scale <.05,1,1>
 +
  scale <1,BDog,1>
 +
  texture {DHull}
 +
}
 +
#end 
 +
 +
//!!!!!!!!!!!!!!!!!!!!!!!!! SUPPORT !!!!!!!!!!!!!!
 +
#macro RSupport(d,DSa,H)
 +
  #local R1 = seed(d);     
 +
  #local M = int(H+(rand(R1)*2));
 +
  #local i = 0;
 +
  #local L = .15;
 +
  intersection {
 +
    union {
 +
      lathe {
 +
        cubic_spline
 +
        M+4, // number of points
 +
          <2+L,-2>,
 +
          <1+L,-1>,
 +
          #while (i<M)
 +
            <.2+sqrt(rand(R1))+L,i+rand(R1)>,
 +
            #local i = i+1;
 +
          #end
 +
          #local SphSz = .1+rand(R1)*2;
 +
          <SphSz+L, i+1>,
 +
          <0, i+1.5> 
 +
      }
 +
     
 +
      #if (DSa>1)
 +
        #local Null = rand(R1); //to make up for the extra random call in the Dome macro
 +
      #else
 +
          object{Dome(SphSz+L) translate (i+1)*y}
 +
      #end
 +
    }
 +
   
 +
    plane {x, 1}
 +
    plane {x,-1 inverse}
 +
    plane {z,0}
 +
    scale <.1,1,1>
 +
    texture {DHull}
 +
  }
 +
 +
#end
 +
 +
//!!!!!!!!!!!!!!!!!!!!!!!!! BAY !!!!!!!!!!!!!!
 +
// The Balcony
 +
#macro Bay(d)
 +
  #local B = .1+.1*rand(RX);
 +
  #local A = 1+rand(RX);
 +
  union {
 +
    union {
 +
      torus { A, B }
 +
      cylinder {-B*y,B*y,A}
 +
      texture {
 +
        gradient y
 +
        texture_map {
 +
          [0.0 Bex1]
 +
          [0.1 Bex1]
 +
          [0.1 DHull]
 +
          [1.0 DHull]
 +
        }
 +
        warp {repeat y flip y} 
 +
      }
 +
      scale <1,.25,1>
 +
      translate 2*x
 +
    }
 +
    union {
 +
      cylinder {0,2*x,A*.5}
 +
      sphere {2*x, A*.5}
 +
      scale <1,.25,1>
 +
      translate -.25*y
 +
    }
 +
  }
 +
 +
#end
 +
 +
//!!!!!!!!!!!!!!!!!!!!!!!!! PATH !!!!!!!!!!!!!!
 +
#macro Path(d,Rot)
 +
  #local B = .2+rand(RX)*.6;
 +
  #local A = .5+rand(RX);
 +
 +
  union {
 +
    torus {A,B}
 +
    #local i = 0;
 +
    #while (i<Rot)
 +
      cylinder {A*x,0,B/2 rotate 90*y rotate i*(360/Rot)*y}
 +
      #local i = i+1;
 +
    #end
 +
    texture {
 +
      gradient y
 +
      texture_map {
 +
        [0.0 DHull]
 +
        [0.5 Test]
 +
        [0.5 DomeTex]
 +
        [1.0 DomeTex]
 +
      }
 +
      translate -.5*y
 +
      scale <1,3,1>
 +
    }
 +
    scale <1,.5,1>
 +
  }
 +
 
 +
#end
 +
 +
//!!!!!!!!!!!!!!!!!!!!!!!!! COCOON !!!!!!!!!!!!!!
 +
#macro Cocoon(d,Y,SZ)
 +
  union {
 +
    difference {
 +
      sphere {0,1}
 +
      plane {y,.5 rotate -45*z inverse}
 +
      scale <1,Y,1>
 +
      scale <1,SZ,1>
 +
      material {BTex(d,int(5+rand(RX)*3))}
 +
    }
 +
    sphere {0,.98 scale <1,Y,1> scale <1,SZ,1> texture{DomeTex}}
 +
  }
 +
#end
 +
 +
//################################################################### MAIN ##################################
 +
 +
#macro Body(d,H)                        // d:  random seed--if you plug in the same two numbers everytime, you'll get the same building everytime.
 +
                                        // H:  Approximate height of the building. 
 +
 +
  #local R1 = seed(d);                  // It is essential that "R1" only be used for determining the lathe structure
 +
  #local RX = seed(d+1);                // All other random elements use "RX"
 +
  #local M = int(H+(rand(R1)*2));      // Determines the height of the Building
 +
  #local i = 0;
 +
  #local Rot = int(5+rand(RX)*3);      // Determines the number of times the pattern will repeat around the building
 +
  #local DS = int(rand(RX)*2);          // Used to determine whether or not the dome will have supports
 +
  BfTex(d)                              // Establishes a base texture for the building
 +
 
 +
 
 +
  union {
 +
    // Creates the basic shape of the building: the essence of the macro
 +
    lathe {
 +
      cubic_spline
 +
      M+4,                            // number of points
 +
      <2,-2>,
 +
      <1,-1>,
 +
      #while (i<M)
 +
        <.2+sqrt(rand(R1)),i+rand(R1)>,
 +
        #local i = i+1;
 +
      #end
 +
      #local SphSz = .1+rand(R1)*2;
 +
      <SphSz, i+1>,
 +
      <0, i+1.5> 
 +
      material {BTex(d,Rot)}            // Creates the texture
 +
    }
 +
   
 +
    // Place a dome on top
 +
    object{Dome(SphSz) texture {DomeTex} translate (i+1)*y}
 +
   
 +
    // Generate supporting ridges along the surface of the building
 +
    #if (rand(RX)>.5)
 +
      union {
 +
        #local i = 0;
 +
        #while (i<Rot)
 +
          object{ RSupport(d,DS,H) rotate 90*y rotate i*(360/Rot)*y}
 +
          #local i = i + 1;
 +
        #end
 +
      }
 +
    #end
 +
   
 +
    // Generate Butresses that separate from the structure
 +
    #if (rand(RX)>.6)
 +
      union {
 +
        #local i = 0;
 +
        #local DDog = rand(RX)*.25;
 +
        #local BDog = rand(RX)+.25;
 +
        #while (i<Rot)
 +
          object{ Brace(d,DDog,BDog) rotate 90*y rotate i*(360/Rot)*y }
 +
          #local i = i + 1;
 +
        #end
 +
        translate rand(RX)*(H-1)*y
 +
      }
 +
    #end
 +
   
 +
    //  Add balconies
 +
    #if (rand(RX)>.5)
 +
      union {
 +
        #local i = 0;
 +
        #local DDog = .2+rand(RX)*.4;
 +
        #while (i<Rot)
 +
          object{Bay(d) scale DDog rotate 90*y rotate i*(360/Rot)*y }
 +
          #local i = i + 2;
 +
        #end
 +
        translate rand(RX)*M*y
 +
      }
 +
    #end
 +
   
 +
    // Add toroidal, domed structures around the building
 +
    #local i = 0;
 +
    #local MPath = int(rand(RX)*5.5);
 +
    #while (i<MPath)
 +
        object{Path(d,Rot)
 +
        translate rand(RX)*H*y
 +
      }
 +
      #local i = i+1;
 +
    #end
 +
   
 +
    //  Add spherical "Cocoons" hanging on to the building
 +
    #if (rand(RX)>.2)
 +
      union {
 +
        #local i = 0;
 +
        #local DDog = 1+rand(RX)*3;
 +
        #local BDog = .2+rand(RX)*.5;
 +
        #while (i<Rot)
 +
          object{Cocoon(d,DDog,BDog) translate (1-(BDog*.5))*x rotate 90*y rotate i*(360/Rot)*y }
 +
          #local i = i + 1;
 +
        #end
 +
        translate rand(RX)*M*y
 +
      }
 +
    #end
 +
    //scale (1+rand(R1))*y
 +
  }
 +
 +
#end
  
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
And finally a simple example scene <code>KA_Sci-FiGen.pov</code>:
 +
 +
<syntaxhighlight lang="pov">
 +
// Persistence of Vision Ray Tracer Scene Description File
 +
// File: KA_Sci-FiGen.pov
 +
// Vers: 3.6
 +
// Desc: Example Scene using Sci-FiGen.inc
 +
// Auth: Kirk Andrews
 +
//
 +
 +
#version 3.6;
 +
 +
#include "colors.inc"
 +
 +
global_settings {
 +
  assumed_gamma 1.0
 +
}
 +
 +
//Atmosphere
 +
 +
light_source {
 +
  <0, 0, 0>            // light's position (translated below)
 +
  color rgb <1, .8, .5>  // light's color
 +
  translate <-300, 100, 100>
 +
}
 +
 +
light_source {
 +
  <0, 0, 0>            // light's position (translated below)
 +
  color rgb <.1, .0, .1>*.5  // light's color
 +
  translate < 300, -100, -100>
 +
  shadowless
 +
}
 +
 +
fog {
 +
  fog_type  2
 +
  distance  100
 +
  color      rgb <1,1,.9> // gray
 +
  fog_offset 0.1
 +
  fog_alt    6.2
 +
  turbulence 0.8
 +
}
 +
 +
sky_sphere {
 +
  pigment {
 +
    gradient y
 +
    color_map {
 +
      [0.0 rgb <1,.7,.4>]
 +
      //[0.2 rgb <0,0,.2>]
 +
      [0.7 rgb <0,0,.02>]
 +
    }
 +
  }
 +
}
 +
 +
camera {
 +
  location  < 2.5, 23.0, - 5.0>
 +
  look_at  < 2.7, 25.0,  10.0>
 +
  right    x*image_width/image_height
 +
}
 +
 +
//#################################################################
 +
#include "Sci-FiGen.inc"
 +
 +
#declare RR = seed(8); //Try different values here for completely different sets of buildings.
 +
 +
#declare X = 0;
 +
#declare Z = 0;
 +
#declare XM = 4;
 +
#declare ZM = 20;
 +
 +
union {
 +
  #while (X<XM)
 +
    #while (Z<ZM)
 +
      object {
 +
        Body(rand(RR)*1000, 20+rand(RR)*20)
 +
        translate <X,0,Z>*5
 +
      }
 +
      #declare Z=Z+1;
 +
    #end
 +
    #declare Z=0;
 +
    #declare X=X+1;
 +
  #end
 +
}             
 +
 +
</syntaxhighlight>
 +
<hr />
 +
 
<p>blah blah blah blah blah.......</p>
 
<p>blah blah blah blah blah.......</p>
  

Latest revision as of 07:14, 3 May 2026

INTRODUCTION

This is a haphazard collection of stuff assembled over the last 30 years and written by a large number of POV-Ray users.

I am not the original writer/owner of the following files, only the collector. For all files the usual copyright terms of POV-Ray apply:


The files are licensed under the terms of the CC-LGPL.

Use and/or modification of the scenes is free, except for commercial purposes.

Commercial distribution is not allowed without written permission from their mentioned authors.


MORAY-GENERATED FILES AND AXES ORIENTATION

Some of the scene files below were generated by Moray V3.01 For Windows (c) 1991-1998 Lutz + Kretzschmar.

The scene axes orientation of these scene files are right-handed with the z-axis pointing upwards!

If you want to use them in a POV-Ray environment you need to convert them to the standard orientation (left-handed with the y-axis pointing upwards).

You can achieve this by applying the following transformation to each of the elements/objects in the files (courtesy: Txemi Jendrix):

transform {
  scale <1, 1, -1>
  rotate <90, 0, 0>
}

Usage example:

#include "MyIncludeFile.inc"
object {MyObject 
  texture {MyTexture}
  transform {
    scale <1, 1, -1>
    rotate <90, 0, 0>
  }
}


LIST OF TOPICS

  • cloth
  • constructions
  • glass
  • landscape
  • nature
  • wood
  • stone
  • sky
  • water


TOPIC: SKY


topic: sky

title: Rainbow

Carlucci's Rainbow

year: 1998

author: Angelo Carlucci

description: A rainbow as seen through a raindrop-spattered window.

link: none available

comment 1: This scene file was originally generated for POV-Ray V3.0 by Moray V3.01 For Windows (c) 1991-1998 Lutz + Kretzschmar. Created for the "IRTC".

comment 2: See above for how to handle those files.

code snippets: To help interpret and use Moray-generated POV-Ray code, the original global_settings and camera codes have also been provided.

global_settings {
  adc_bailout 0.003922
  ambient_light <1.0,1.0,1.0>
  assumed_gamma 1.9
  hf_gray_16 off
  irid_wavelength <0.247059,0.176471,0.137255>
  max_intersections 64
  max_trace_level 10
  number_of_waves 10
  radiosity {
    brightness       3.3
    count            100
    //distance_maximum 0.0
    error_bound      0.4
    gray_threshold   0.5
    low_error_factor 0.8
    minimum_reuse    0.015
    nearest_count    6
    recursion_limit  1
  }
}

camera {
  location  <-4.550, 6.800, 5.000>
  direction <0.0,     0.0,  1.2659>
  sky       <0.0,     0.0,  1.0>  // Use right handed-system!
  up        <0.0,     0.0,  1.0>  // Where Z is up
  right     <1.33333,  0.0,  0.0>
  look_at   <-2.250, 3.600, 6.800>
  // Focal blur settings
  focal_point  <-2.250, 3.600, 6.800> // Always Lookat
  aperture     0.3
  blur_samples 100
  confidence   0.999
  variance     0.0001
}

#declare Rainbow = 
texture {   
  pigment {
    wood
    color_map {
      [ 0.000000  rgbft <1.0, 1.0, 1.0, 0.0, 1.0> ]
      [ 0.789894  rgbft <1.0, 1.0, 1.0, 0.0, 1.0> ]
      [ 0.805851  rgbft <0.6, 0.0, 1.0, 0.0, 0.95> ]
      [ 0.819149  rgbft <0.0, 0.0, 1.0, 0.0, 0.92> ]
      [ 0.837766  rgbft <0.0, 1.0, 0.0, 0.0, 0.85> ]
      [ 0.861702  rgbft <1.0, 1.0, 0.0, 0.0, 0.85> ]
      [ 0.938830  rgbft <1.0, 0.0, 0.0, 0.0, 0.85> ]
      [ 1.000000  rgbft <1.0, 1.0, 0.986667, 0.0, 1.0> ]
    }
    scale  2.0
  }   
  finish {
    ambient 0.7
    diffuse 0.0
  }
}

disc {
  <0,0,0>, <0,0,1>, 1.0
  texture {Rainbow}
  no_shadow
  scale 50.0
  rotate <-45.0, -90.0, 0.0>
  translate  <31.1, 3.35, -10.8>
}

next blah blah blah...




TOPIC: CLOTH


topic: cloth

title: Crushed Velvet

Bob Hughes' Crushed Velvet

year: 2000

author: Bob Hughes

description: An attempt at making a crushed velvet texture.

link: https://news.povray.org/povray.text.scene-files/thread/%3C389e81fc%40news.povray.org%3E/?ttop=440712&toff=700

comment: Updated to POV-Ray 3.8, added warp turbulence, and changed to macro access by TdG (2023).

code: The following code should be saved in an include file, like crushedvelvet.inc


#macro Velvet(Vb,Vt,Vs,Vc)
// BEGIN VELVET CHOICES

// Color Brightness [ > 0 to 2 ? ]
#ifndef (Vb) #declare Vb = 1; #end
// Velvet Thickness [ 0 to 3 ? ]
#ifndef (Vt) #declare Vt = 1.5; #end
// Velvet Size [ 0 to 6 ? ]
#ifndef (Vs) #declare Vs = 1; #end
// Color Choice [ 1= black, 2= red, 3= green, 4= blue ]
#ifndef (Vc) #declare Vc = 2; #end

// END VELVET CHOICES

// Color Choice
#switch (Vc)
#case (1)
// Black
#declare Cv1 = <.05,.05,.05>;
#declare Cv2 = <.1,.1,.1>;
#declare Cv3 = <.075,.075,.075>;
#declare Cv4 = <.1,.1,.1>;
#declare Cv5 = <.05,.05,.05>;
#declare Cv6 = <.1,.1,.1>;
#declare Cfv1 = rgbf<.05,.05,.05,.4>;
#declare Cfv2 = rgbf<.1,.1,.1,.5>;
#declare Cfv1a = rgbf<.05,.05,.05,.1>;
#declare Cfv1b = rgbf<.1,.1,.1,.05>;
#declare Cfv2a = rgbf<.05,.05,.05,.1>;
#declare Cfv2b = rgbf<.1,.1,.1,.05>;
#break
#case (2)
// Red
#declare Cv1 = <.7,.1,.1>;
#declare Cv2 = <.75,.15,.2>;
#declare Cv3 = <.65,.15,.15>;
#declare Cv4 = <.65,.15,.25>;
#declare Cv5 = <.6,.1,.1>;
#declare Cv6 = <.65,.15,.15>;
#declare Cfv1 = rgbf<.5,.1,.1,.4>;
#declare Cfv2 = rgbf<.55,.1,.15,.5>;
#declare Cfv1a = rgbf<.6,.1,.1,.1>;
#declare Cfv1b = rgbf<.65,.15,.15,.05>;
#declare Cfv2a = rgbf<.6,.1,.1,.1>;
#declare Cfv2b = rgbf<.75,.15,.25,.05>;
#break
#case (3)
// Green
#declare Cv1 = <.1,.5,.2>;
#declare Cv2 = <.1,.65,.25>;
#declare Cv3 = <.1,.5,.3>;
#declare Cv4 = <.2,.6,.2>;
#declare Cv5 = <.1,.7,.1>;
#declare Cv6 = <.15,.65,.25>;
#declare Cfv1 = rgbf<.2,.5,.2,.4>;
#declare Cfv2 = rgbf<.3,.55,.25,.5>;
#declare Cfv1a = rgbf<.2,.6,.3,.1>;
#declare Cfv1b = rgbf<.2,.7,.3,.05>;
#declare Cfv2a = rgbf<.1,.6,.15,.1>;
#declare Cfv2b = rgbf<.15,.65,.2,.05>;
#break
#case (4)
// Blue
#declare Cv1 = <.1,.3,.7>;
#declare Cv2 = <.2,.4,.65>;
#declare Cv3 = <.12,.24,.58>;
#declare Cv4 = <.3,.5,.6>;
#declare Cv5 = <.2,.4,.7>;
#declare Cv6 = <.25,.35,.65>;
#declare Cfv1 = rgbf<.22,.34,.77,.4>;
#declare Cfv2 = rgbf<.35,.45,.75,.5>;
#declare Cfv1a = rgbf<.12,.24,.6,.1>;
#declare Cfv1b = rgbf<.2,.3,.7,.05>;
#declare Cfv2a = rgbf<.12,.24,.6,.1>;
#declare Cfv2b = rgbf<.2,.3,.7,.05>;
#break
#end

// BEGIN VELVET TEXTURE DEFINITION

#declare T1 =
texture {
  pigment {
    wrinkles frequency .666 
    color_map {
      [0 color rgb Cv1*Vb]
      [1 color rgb Cv2*Vb]
    } 
    sine_wave 
  }
  normal { 
    crackle 10 
    normal_map {
      [0.1 wrinkles 8 triangle_wave scale <3,.5,1>*10 rotate <15,30,5>]
      [0.3 crackle 8 scallop_wave scale <3,.5,1>*10 rotate <15,30,5>]
      [0.9 leopard 8 triangle_wave scale <3,.5,1>*10 rotate <15,30,5>]
    } 
    triangle_wave 
    scale <3,.5,1>*5 
    rotate <15,30,5> 
  }
  finish {
    diffuse .3
    fresnel on
    reflection {<.05,.075,.1> fresnel on} crand .013
    brilliance -.25*Vt
  }
}

#declare T2 =
texture {
  pigment { 
    crackle frequency 2 
    color_map {
      [0 color rgb Cv3*Vb]
      [1 color rgb Cv4*Vb]
    } 
    scallop_wave 
  }
  normal { 
    agate 7.5 agate_turb .6 
    normal_map {
      [0.1 wrinkles 8 triangle_wave scale <3,.5,1>*10 rotate <15,30,5>]
      [0.3 crackle 8 scallop_wave scale <3,.5,1>*10 rotate <15,30,5>]
      [0.9 leopard 8 triangle_wave scale <3,.5,1>*10 rotate <15,30,5>]
    }
    scallop_wave 
    scale <3,.5,1>*10 
    rotate <15,30,5> 
  }
  finish {
    diffuse .35
    fresnel on
    reflection {<.05,.075,.1> fresnel on} crand .013
    brilliance -.3*Vt
  }
}

#declare T3 =
texture {
  pigment { 
    granite frequency .5 
    color_map {
      [0 color rgb Cv5*Vb]
      [1 color rgb Cv6*Vb]
    } 
    triangle_wave 
  }
  normal { 
    bozo 5  
    turbulence .9 
    normal_map {
      [0.1 wrinkles 8 triangle_wave scale <3,.5,1>*10 rotate <15,30,5>]
      [0.3 crackle 8 scallop_wave scale <3,.5,1>*10 rotate <15,30,5>]
      [0.9 leopard 8 triangle_wave scale <3,.5,1>*10 rotate <15,30,5>]
    } 
    sine_wave 
    scale <3,.5,1>*15 
    rotate <15,30,5> 
  }
  finish {
    diffuse .4
    fresnel on
    reflection {<.05,.075,.1> fresnel on} crand .013
    brilliance -.35*Vt
  }
}

#declare Tf =
texture {
  pigment { 
    wrinkles frequency 2 
    color_map {
      [0 color Cfv1*Vb]
      [1 color Cfv2*Vb]
    }  
  }
  finish {
    diffuse 1.25
    fresnel on
    reflection {<.05,.075,.1> fresnel on} crand .013
    brilliance -.75*Vt 
    metallic .6
  }
}
texture {
  pigment { 
    wrinkles frequency 2 
    color_map {
      [0 color Cfv1*Vb]
      [1 color Cfv2*Vb]
    }  
  }
  finish {
    diffuse .05
    fresnel on
    reflection {<.05,.075,.1>*.25 fresnel on} crand .013
    brilliance .125*Vt 
    metallic .3
  }
}

#declare P1 =
pigment { 
  granite 
  color_map {
    [0 color Cfv1a*Vb]
    [1 color Cfv1b*Vb]
  } 
}

#declare P2 =
pigment { 
  granite 
  color_map {
    [0 color Cfv2a*Vb]
    [1 color Cfv2b*Vb]
  } 
}

#declare Tp1 =
texture {
  pigment { 
    gradient x turbulence .09 frequency .333
    pigment_map {
      [0 P1]
      [1 P2]
    } 
    scallop_wave 
  }
  finish {
    diffuse .5
    fresnel on
    reflection {<.05,.075,.1> fresnel on} crand .016
    brilliance .125*Vt
  }
}

#declare Tp2 =
texture {
  pigment { 
    gradient y turbulence .09 frequency .333
    pigment_map {
      [0 P1]
      [1 P2]
    } 
    scallop_wave 
  }
  finish {
    diffuse .5
    fresnel on
    reflection {<.05,.075,.1> fresnel on} crand .016
    brilliance .125*Vt
  }
}

#declare Tp3 =
texture {
  pigment { 
    gradient z turbulence .09 frequency .333
    pigment_map {
      [0 P1]
      [1 P2]
    } 
    scallop_wave 
  }
  finish {
    diffuse .5
    fresnel on
    reflection {<.05,.075,.1> fresnel on} crand .016
    brilliance .125*Vt
  }
}

//  FINAL VELVET TEXTURE
#declare CVelvet =
texture { 
  average
  texture_map {
    [1.000 T1]
    [0.750 T2]
    [0.875 T3]
    [0.705 Tf]
    [0.900 Tp1]
    [0.900 Tp2]
    [0.900 Tp3]
  }
  warp {turbulence 2.5} //added by TdG (2023)
  scale .05*Vs
}

#end  //of Velvet macro

topic: cloth

title: Tartan

Anon's Tartan

year: 2002 / macro version: 2014

author: Unknown (macro version: TdG)

description: A tartan cloth texture, based on the Moray scene McGregor.mdl.

link: none available

comment:

code:

#version 3.7;

#ifndef(Standalone) #declare Standalone = on;  #end

global_settings {
  assumed_gamma 1
}

#declare Col1 = <1.0, 0.0, 0.0>;//original: red
#declare Col2 = <1.0, 0.0, 0.0>;//original: red
#declare Col3 = <0.0, 0.0, 0.0>;//original: black

#declare Pig1 =
pigment {
  gradient x
  color_map {
    [0.190 srgb Col3]
    [0.190 srgb Col1]
    [0.233 srgb Col1]
    [0.233 srgb Col3]
    [0.304 srgb Col3]
    [0.304 srgb <1.0, 1.0, 1.0>]
    [0.325 srgb <1.0, 1.0, 1.0>]
    [0.325 srgb Col3]
    [0.396 srgb Col3]
    [0.396 srgb Col1]
    [0.441 srgb Col1]
    [0.441 srgb Col3]
    [0.625 srgb Col3]
    [0.625 srgb Col1]
  }
}               

#declare Pig2 =
pigment {
  gradient x
  color_map {
    [0.190 srgb Col3]
    [0.190 srgb Col2]
    [0.233 srgb Col2]
    [0.233 srgb Col3]
    [0.304 srgb Col3]
    [0.304 srgb <1.0, 1.0, 1.0>]
    [0.325 srgb <1.0, 1.0, 1.0>]
    [0.325 srgb Col3]
    [0.396 srgb Col3]
    [0.396 srgb Col2]
    [0.441 srgb Col2]
    [0.441 srgb Col3]
    [0.625 srgb Col3]
    [0.625 srgb Col2]
  }
}               

#declare Mat_McGregor = 
material {   
  texture {
    pigment_pattern {
      gradient <1.0, 1.0, 0.0>
      color_map {
        [0.0 srgb <0.0, 0.0, 0.0>]
        [0.5 srgb <0.0, 0.0, 0.0>]
        [0.9 srgb <1.0, 1.0, 1.0>]
        [1.0 srgb <1.0, 1.0, 1.0>]
      }
      scale  0.03
      rotate 45.0*y
    }
    texture_map {
      [0.0 pigment {Pig1}]
      [1.0 pigment {Pig2} rotate -90.0*y]
    }
  }
}

#if (Standalone)

global_settings {
  adc_bailout 0.003922
  ambient_light <1.0,1.0,1.0>
  assumed_gamma 1
  hf_gray_16 off
  irid_wavelength <0.247059,0.176471,0.137255>
  max_intersections 64
  max_trace_level 10
  number_of_waves 10
  noise_generator 2
  charset ascii
}

background { color <0.000,0.000,0.000> }

camera {  //  Camera Camera01
  location  <-1, 1, -1>*3
  sky       y 
  up        y
  right     x*image_width/image_height
  angle     50
  look_at   <0, 0, 0>
}

//
// *******  L I G H T S *******
//

light_source {
  <0.0, 0.0, 0.0>
  color rgb <1.000, 1.000, 1.000>
  translate  <10, 10, -10>
}

plane {
  y, 0
  material {Mat_McGregor}
}


#end

next blah blah blah...




TOPIC: WOOD


topic: wood

title: Eureka Wood

Charles Fusner's Eureka Wood

year: 1997/1999

author: Charles Fusner

description: A dark, somewhat reddish brown wood with very tiny, delicate grain, augmented by a nearly subliminal 2nd layer consisting of faint black speckles elongated along the grain.

link: none available

comment:

code: The following code should be saved in an include file, like ewood.inc


#declare texEurekaWood =
texture {
  pigment {
    wood
    color_map {
      [ 0.00 color rgb <0.53, 0.23, 0.13> ]
      [ 0.45 color rgb <0.53, 0.23, 0.13> ]
      [ 0.55 color rgb <0.58, 0.28, 0.18> ]
      [ 1.00 color rgb <0.58, 0.28, 0.18> ]
    }
    scallop_wave
    scale .1
    warp { turbulence < .04, .04, 0 > lambda 1.8 omega .375 }
  }
  finish {
    specular .05 roughness 1.0
    crand .1
  }
}
texture {
  pigment {
    granite
    color_map {
      [ 0.00 rgbt<0.25, 0.15, 0.15, 0.25> ]
      [ 0.05 rgbt<.58, .23, .13, 0.25> ]
      [ 0.10 rgbt<.58, .23, .13, 1.0> ]
      [ 1.00 rgbt<.58, .23, .13, 1.0> ]
    }
    frequency 6
    scale <1,1,100>
  }
  finish {
    specular .05 roughness 1.0
    crand .1
  }
}

next blah blah blah...



TOPIC: CONSTRUCTIONS


topic: constructions

title: Sci-FiGen

Kirk Andrews' Sci-FiGen

year: 2007

author: Kirk Andrews

description: Set of macros to generate random science-fiction-like buildings.

link: none available

comment 1: The following images are required:

comment 2:

A building is created using the Body(any seed number, desired height) macro.

Using the same number for both values will produce the same building every time. If you want the buildings to look different, be sure to use different numbers. In the example scene provided, this has been addressed.

code: The following code files are provided. First Sci-FiGenTex.inc

//name to use for this include file:
//Sci-FiGenTex.inc

#declare DWindow =
  texture{ 
    pigment {
      color rgb <0.572549019607843,1,0.552941176470588> filter  .1 
    } 
    finish{
      specular .1 
      roughness 0.00286312 
      ambient rgb .2 
      diffuse 0.6  
      reflection{.5 metallic} 
      conserve_energy
    }
  }

#declare DHull =
  texture{ 
    pigment {color rgb .2 transmit  0} 
    //normal {bumps .2}
    finish{
      specular .1 metallic 
      roughness 0.286312 
      ambient rgb <0,0,0> 
      diffuse 0.7  
      reflection{.0 metallic} 
      conserve_energy
    }
  }

#declare Bex1 =
texture {
  pigment { rgb <.7,.7,1> }
  normal {bumps .1}
  finish {
    ambient .4
    specular .5 metallic roughness .001
    reflection .0 metallic conserve_energy
    irid {0.25 thickness .5 turbulence .5}
  }
}

#declare AmWindow =
  texture {
    bumps
    //scale .25*y
    texture_map {
      [0.0 Bex1]
      [0.7 Bex1]
      [0.7 DHull]
      [1.0 DHull]
    } 
    //scale .1
  }

#declare Mix1 = 
texture {
  gradient y
  //scale .1*y
  texture_map {
    [0.0 DHull]
    [0.9 DHull]
    [0.9 AmWindow]
    [1.0 AmWindow]
  }
}
     
#declare Mix2 = 
texture {
  gradient y
  //scale .1*y
  texture_map {
    [0.0 DHull]
    [0.3 DHull]
    [0.3 AmWindow]
    [1.0 AmWindow]
  }
}

#declare Mix =
texture {
  bumps
  scale .05
  texture_map {
    [0.0 Mix1]
    [0.8 Mix1]
    [0.8 Mix2]
    [1.0 Mix2]
  } 
  //scale <100,40,100>
}
    
//=====================================================================

#declare Tex1 =
texture { 
  pigment {rgb .3}
  //normal {bumps .1 turbulence .3 scale .01}
  finish {ambient 0}
}

#declare Tex2 =
texture { Mix
  //pigment {rgb .2}
  //finish {specular 1 metallic reflection .2 metallic}
}

#declare Tex3 =
texture { DHull
  //pigment {rgb <.6,.6,1>}
  
}

#declare Tex4 =
texture {
  pigment {rgb .2}
  finish {specular .1 reflection .00 ambient 0}
}


#declare Test =
texture {
// pattern for use in texture/pigment/normal/density
// takes the color of an image file to calculate the pattern value
  image_pattern {
    jpeg "Deline05.jpg"   // image file to read (iff/tga/gif/png/jpeg/tiff/sys)
    //use_color         // use pixel color gray scale (default)
    //use_alpha         // use alpha value
    //use_index         // use palette index  
  }
  scale <1/3,3/1,1>
  warp {repeat y flip y}
  texture_map {
    [0.0  Tex1]
    [0.25  Tex3]
    [0.75  Tex4]
    [1.0  Tex2]
  }
  warp {cylindrical}
}

Second Sci-FiGen.inc:

//name to use for this include file:
//Sci-FiGen.inc

#include "colors.inc"
#include "Sci-FiGenTex.inc"

// sets the default texture that objects get when they have no texture specified
#default {
  texture { 
    pigment {color rgb 1} 
    finish{
      ambient 0.0 
      specular .0
      diffuse 0.2
    } 
  }
}

//###################################################################################################################
//########################################## Texture Generators #####################################################
//###################################################################################################################

#macro BfTex(d) 

  #local R2 = seed(d);


  #declare Tex1 =
  texture { 
    pigment {rgb .1+rand(R2)*.3}
    //normal {bumps .1 turbulence .3 scale .01}
    finish {ambient 0 diffuse .3+rand(R2)*.5  specular rand(R2)*.3 metallic}
  }
  
 
  #declare Tex4 =
  texture {
    pigment {rgb .1+rand(R2)*.3}
    finish {specular rand(R2)*.3 metallic reflection .00 ambient 0  diffuse (.3+rand(R2)*.5)}
  }

#end

#macro BTex(d,Rot) 

  #local R2 = seed(d);
  
  //BfTex(d)
  
  texture {
    image_pattern {
      #switch (int(rand(R2)*6))
        #case (0)  jpeg "Deline.jpg" #break
        #case (1)  jpeg "Deline02.jpg" #break
        #case (2)  jpeg "Deline03.jpg" #break
        #case (3)  jpeg "Deline04.jpg" #break
        #case (4)  jpeg "Deline05.jpg" #break
        #case (5)  jpeg "Deline.jpg" #break
        #else      jpeg "Deline.jpg" 
      #end
    }
    scale <1/Rot, 3, 1>
    warp {repeat y flip y}
    texture_map {
      [0.0  Tex1]
      [0.25  Tex3]
      [0.75  Tex4]
      [1.0  Tex2]
    }
    warp {cylindrical}
  }
#end


#declare DomeTex =
texture {
    pigment {rgb 1 transmit .9} 
    finish{ 
      reflection .5 
      metallic 
      irid{.25 thickness .5}
    }

}

//###################################################################################################################
//########################################## Geometry Generators ####################################################
//###################################################################################################################

//!!!!!!!!!!!!!!!!!!!!!!!!! DOME !!!!!!!!!!!!!!
#macro Dome(Sz)
  difference {
    sphere {
      0,Sz 
    }
    plane {y,0}
    sphere {0,Sz-.15}
  
    scale <1, (.25+rand(R1)), 1>
     
  }
#end  

//!!!!!!!!!!!!!!!!!!!!!!!!! BRACE !!!!!!!!!!!!!!
#macro Brace (d,DDog,BDog) //Random Seed, Controls thickness of brace, Controls angle of brace
difference {
  lathe {
    quadratic_spline 
    7
    <1.75,-100>,
    <1.75,-50>,
    <1.75,-25>,
    <1.75,-20>, 
    <1.75,-10>,
    <1.75,  0>,
    <1, 4>
    //<0,  5>
    sturm
  }
  //#local DDog = rand(RX)*.4;
  sphere {0*y,1.5+DDog}
  cylinder {0*y,-110*y,1.5+DDog}
  plane {x,-1}
  plane {x, 1 inverse}
  plane {z,0}
  translate -4*y
  scale <.05,1,1>
  scale <1,BDog,1> 
  texture {DHull}
}
#end  

//!!!!!!!!!!!!!!!!!!!!!!!!! SUPPORT !!!!!!!!!!!!!!
#macro RSupport(d,DSa,H)
  #local R1 = seed(d);      
  #local M = int(H+(rand(R1)*2));
  #local i = 0;
  #local L = .15;
  intersection {
    union {
      lathe {
        cubic_spline 
        M+4, // number of points
          <2+L,-2>,
          <1+L,-1>,
          #while (i<M)
            <.2+sqrt(rand(R1))+L,i+rand(R1)>,
            #local i = i+1;
          #end
          #local SphSz = .1+rand(R1)*2;
          <SphSz+L, i+1>,
          <0, i+1.5>   
      }
      
      #if (DSa>1)
         #local Null = rand(R1); //to make up for the extra random call in the Dome macro 
      #else
          object{Dome(SphSz+L) translate (i+1)*y}
      #end
    }
     
    plane {x, 1}
    plane {x,-1 inverse}
    plane {z,0}
    scale <.1,1,1> 
    texture {DHull}
  }

#end

//!!!!!!!!!!!!!!!!!!!!!!!!! BAY !!!!!!!!!!!!!!
// The Balcony
#macro Bay(d)
  #local B = .1+.1*rand(RX); 
  #local A = 1+rand(RX); 
  union {
    union {
      torus { A, B }
      cylinder {-B*y,B*y,A}
      texture {
        gradient y
        texture_map {
          [0.0 Bex1]
          [0.1 Bex1]
          [0.1 DHull]
          [1.0 DHull]
        }
        warp {repeat y flip y}  
      }
      scale <1,.25,1>
      translate 2*x
    }
    union {
      cylinder {0,2*x,A*.5}
      sphere {2*x, A*.5}
      scale <1,.25,1>
      translate -.25*y
    }
  } 

#end

//!!!!!!!!!!!!!!!!!!!!!!!!! PATH !!!!!!!!!!!!!!
#macro Path(d,Rot)
  #local B = .2+rand(RX)*.6; 
  #local A = .5+rand(RX); 

  union {
    torus {A,B}
    #local i = 0;
    #while (i<Rot)
      cylinder {A*x,0,B/2 rotate 90*y rotate i*(360/Rot)*y}
      #local i = i+1;
    #end
    texture {
      gradient y
      texture_map {
        [0.0 DHull]
        [0.5 Test]
        [0.5 DomeTex]
        [1.0 DomeTex]
      }
      translate -.5*y
      scale <1,3,1>
    }
    scale <1,.5,1>
  }
  
#end

//!!!!!!!!!!!!!!!!!!!!!!!!! COCOON !!!!!!!!!!!!!!
#macro Cocoon(d,Y,SZ)
  union {
    difference {
      sphere {0,1}
      plane {y,.5 rotate -45*z inverse}
      scale <1,Y,1>
      scale <1,SZ,1>
      material {BTex(d,int(5+rand(RX)*3))}
    }
    sphere {0,.98 scale <1,Y,1> scale <1,SZ,1> texture{DomeTex}}
  }
#end

//################################################################### MAIN ##################################

#macro Body(d,H)                        // d:  random seed--if you plug in the same two numbers everytime, you'll get the same building everytime.
                                        // H:  Approximate height of the building.  

  #local R1 = seed(d);                  // It is essential that "R1" only be used for determining the lathe structure
  #local RX = seed(d+1);                // All other random elements use "RX"
  #local M = int(H+(rand(R1)*2));       // Determines the height of the Building
  #local i = 0;
  #local Rot = int(5+rand(RX)*3);       // Determines the number of times the pattern will repeat around the building
  #local DS = int(rand(RX)*2);          // Used to determine whether or not the dome will have supports
  BfTex(d)                              // Establishes a base texture for the building
  
  
  union {
    // Creates the basic shape of the building: the essence of the macro
    lathe {
      cubic_spline 
      M+4,                            // number of points
      <2,-2>,
      <1,-1>,
      #while (i<M)
        <.2+sqrt(rand(R1)),i+rand(R1)>,
        #local i = i+1;
      #end
      #local SphSz = .1+rand(R1)*2;
      <SphSz, i+1>,
      <0, i+1.5>   
      material {BTex(d,Rot)}             // Creates the texture
    }
    
    // Place a dome on top
    object{Dome(SphSz) texture {DomeTex} translate (i+1)*y} 
    
    // Generate supporting ridges along the surface of the building
    #if (rand(RX)>.5)
      union {
        #local i = 0;
        #while (i<Rot)
          object{ RSupport(d,DS,H) rotate 90*y rotate i*(360/Rot)*y}
          #local i = i + 1;
        #end
      }
    #end
    
    // Generate Butresses that separate from the structure
    #if (rand(RX)>.6)
      union {
        #local i = 0;
        #local DDog = rand(RX)*.25;
        #local BDog = rand(RX)+.25;
        #while (i<Rot)
          object{ Brace(d,DDog,BDog) rotate 90*y rotate i*(360/Rot)*y }
          #local i = i + 1;
        #end
        translate rand(RX)*(H-1)*y
      }
    #end
    
    //  Add balconies
    #if (rand(RX)>.5)
      union {
        #local i = 0;
        #local DDog = .2+rand(RX)*.4;
        #while (i<Rot)
          object{Bay(d) scale DDog rotate 90*y rotate i*(360/Rot)*y }
          #local i = i + 2;
        #end
        translate rand(RX)*M*y
      }
    #end
    
    // Add toroidal, domed structures around the building
    #local i = 0;
    #local MPath = int(rand(RX)*5.5);
    #while (i<MPath)
        object{Path(d,Rot)
        translate rand(RX)*H*y
      }
      #local i = i+1;
    #end
    
    //  Add spherical "Cocoons" hanging on to the building
    #if (rand(RX)>.2)
      union {
        #local i = 0;
        #local DDog = 1+rand(RX)*3;
        #local BDog = .2+rand(RX)*.5;
        #while (i<Rot)
          object{Cocoon(d,DDog,BDog) translate (1-(BDog*.5))*x rotate 90*y rotate i*(360/Rot)*y }
          #local i = i + 1;
        #end
        translate rand(RX)*M*y
      }
    #end
    //scale (1+rand(R1))*y
  }

#end

And finally a simple example scene KA_Sci-FiGen.pov:

// Persistence of Vision Ray Tracer Scene Description File
// File: KA_Sci-FiGen.pov
// Vers: 3.6
// Desc: Example Scene using Sci-FiGen.inc
// Auth: Kirk Andrews
//

#version 3.6;

#include "colors.inc"

global_settings {
  assumed_gamma 1.0
}

//Atmosphere

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, .8, .5>  // light's color
  translate <-300, 100, 100>
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <.1, .0, .1>*.5  // light's color
  translate < 300, -100, -100>
  shadowless
}

fog {
  fog_type   2
  distance   100
  color      rgb <1,1,.9> // gray
  fog_offset 0.1
  fog_alt    6.2
  turbulence 0.8
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <1,.7,.4>]
      //[0.2 rgb <0,0,.2>] 
      [0.7 rgb <0,0,.02>]
    }
  }
}

camera {
  location  < 2.5, 23.0, - 5.0>
  look_at   < 2.7, 25.0,  10.0>
  right     x*image_width/image_height
}

//#################################################################
#include "Sci-FiGen.inc"

#declare RR = seed(8); //Try different values here for completely different sets of buildings.

#declare X = 0;
#declare Z = 0;
#declare XM = 4;
#declare ZM = 20;

union {
  #while (X<XM)
    #while (Z<ZM)
      object {
        Body(rand(RR)*1000, 20+rand(RR)*20) 
        translate <X,0,Z>*5
      }
      #declare Z=Z+1;
    #end
    #declare Z=0;
    #declare X=X+1;
  #end
}

blah blah blah blah blah.......