POV-Ray : Newsgroups : povray.binaries.images : Clothed in light. : Re: Not Clothed in light. So partial nudity Server Time
4 May 2024 20:29:01 EDT (-0400)
  Re: Not Clothed in light. So partial nudity  
From: Bald Eagle
Date: 17 Nov 2017 08:00:01
Message: <web.5a0edc2e96756879c437ac910@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> > > I'm sure some of us have some slightly richer looking wood floor macros lying
> > > about. ;)
> > >
> > As I implied to Thomas. The studio is a very old scene. At least ten
> > years old if I made it in Moray. So any contributions are welcome. :-)
>
> I'll see what I can isolate from the Secret Passage scene.
> You'd think there would be a well developed wood floor macro or include file -
> and having had to write the code to make an acceptable wood floor, I can see why
> there might not be one.


This probably needs to be prettied up to make it generally useful, but see how
this works.   (you may have to translate the floor -y*16*12)


// Planked Hardwood Floor with borders
// Bill Walker "Bald Eagle"  2014
// Some textures based on code supplied by Thomas deGroot
// and Nicolas Rougier
//
http://news.povray.org/povray.binaries.images/message/%3C54367691%241%40news.povray.org%3E/#%3C54367691%241%40news.povr
ay.org%3E

//--------------------------------------------------------------------------
#version 3.7;

//##########################################################################
//######################## CONTROL PANEL SETTINGS ##########################
//##########################################################################


//##########################################################################
//##########################################################################
global_settings{
 assumed_gamma 1.0
 ambient_light rgb 0
 max_trace_level 7
 #if (Radiosity)
  radiosity {
   pretrace_start 1 //  0.08
   pretrace_end   1 //  0.04  //  0.01
   count 35    //  150
   nearest_count 5   //  10
   error_bound 1.8  //  0.5
   recursion_limit 2
   low_error_factor 0.5
   gray_threshold 0.0
   minimum_reuse 0.015   //  0.005
   maximum_reuse 0.2
   brightness 1
   adc_bailout 0.01    //  0.005
  }  // end radiosity block
 #else
 #end
  }// end global settings


#include "colors.inc"
#include "functions.inc"
#include "math.inc"
#include "metals.inc"
#include "rand.inc"
//#include "screen.inc"  //  perspective camera only
#include "shapes.inc"
#include "shapes2.inc"
#include "textures.inc"
#include "transforms.inc"
#include "woods.inc"

#declare Feet = 12;


  #declare Camera_Position = < -1.5*Feet, (18+6)*Feet,  -9*Feet> ;  // front
view
  #declare Camera_Look_At  = <  2*Feet,  16 *  Feet,  18*Feet> ;
  #declare Camera_Angle    =  65 ;

 camera {
  location Camera_Position
         right    x*image_width/image_height
         angle    Camera_Angle
         look_at  Camera_Look_At
  }

light_source {<1500, 750, -200> color rgb <1, 0.8, 0>*5}  //  Sun

 light_source {<0*Feet, 25*Feet, 4*Feet> color rgb <1, 1, 1>*0.3}

#declare PlankNormal = normal { gradient x 2
    slope_map {
     [0.00 <0, 1>]
     [0.05 <1, 0>]
     [0.95 <1, 0>]
     [1.00 <0,-1>]
     }
    scale 2
    };

#declare Tone = 1;
#declare YRotate = 0;

#declare DarkWood= rgb <71, 35, 1>;

//(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)
(o)
//(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)
(o)

/*
#declare OakFloor = texture {
   pigment {bozo scale <1, 1, 10>
   color_map {
   //[0.4 rgb <0.9, 0.7, 0.4> * Tone]
   //[0.6 rgb <1.0, 0.8, 0.6> * Tone]
   [0.0 rgb <121/255,  52/255, 13/255> * Tone]
   [0.2 rgb <142/255,  73/255, 18/255> * Tone]
   [0.4 rgb <184/255, 115/255, 48/255> * Tone]

   [0.6 rgb <157/255,  81/255, 23/255> * Tone]
   [0.8 rgb <108/255,  45/255,  4/255> * Tone]
   [1.0 rgb <156/255,  72/255, 26/255> * Tone]
   }
  turbulence 0.5
  scale <1, 1, 10> * 0.5
  rotate y*YRotate
  }
 normal {
  average normal_map {
     [1 PlankNormal]
     [1 wood 0.5
      slope_map {
      [0.0 <0.0, 0>]
      [0.5 <0.5, 1>]
      [1.0 <1.0, 0>]
      }  // end slope map
     turbulence 0.5 scale <1, 1, 10> * 0.5]
    }  // end normal map
    rotate y * YRotate
  }  // end normal
   finish { specular 0.2 reflection 0.1 }  //  finish { specular 0.5 reflection
0.2 }
 }  // end texture
*/

//(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)
(o)
//(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)
(o)

#declare Tone = <1.2, 1.2, 0.3>;
#declare OakFloor =
texture {
    pigment {
     wood
     color_map {
       [0.0 srgb <121,  52, 13>/255 * Tone]
       [0.2 srgb <142,  73, 18>/255 * Tone]
       [0.4 srgb <184, 115, 48>/255 * Tone]
       [0.6 srgb <157,  81, 23>/255 * Tone]
       [0.8 srgb <108,  45,  4>/255 * Tone]
       [1.0 srgb <156,  72, 26>/255 * Tone]
     }
     warp {turbulence <0.6, 0.1, 0.1>}
     scale <1, 1, 10>*0.5
     scale 0.3
     rotate 1*x
     rotate y*10
   }
}

//(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)
(o)
//(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)
(o)

//============= NR_Wood (2003) =============
#declare NR_wood_grain =
pigment {
   wood
   warp {cylindrical orientation y dist_exp 1}
   warp {turbulence 1.25}
   scale <0.5, 30, 1>
   warp {turbulence 0.25}
   scale <1, 10, 1>
   warp {
     black_hole <0, 0.5, 0>, 1
     falloff 2
     strength 1.5
     repeat 7
     turbulence 2
     inverse
   }
}

#declare NR_wood_normal =
function {
   pigment {
     wood
     warp {cylindrical orientation y dist_exp 1}
     warp {turbulence 1.25}
     scale <0.5, 30, 1>
     warp {turbulence 0.25}
     scale <1, 5, 1>
     color_map {[0 rgb <0, 0, 0>] [1 rgb <1, 1, 1>]}
   }
}

#declare NR_woodmap =
color_map {
     [0.00 srgb <0.949, 0.792, 0.514 >]
     [0.30 srgb <0.855, 0.651, 0.376 >]
     [0.60 srgb <0.831, 0.596, 0.275 >]
     [0.90 srgb <0.620, 0.447, 0.204 >]
}

#declare Tone = <1.2, 1.2, 0.3>;
#declare NR_woodmap2 =
     color_map {
       [0.0 srgb <121,  52, 13>/255 * Tone]
       [0.1 srgb <142,  73, 18>/255 * Tone]
       [0.3 srgb <184, 115, 48>/255 * Tone]
       [0.8 srgb <157,  81, 23>/255 * Tone]
       //[0.8 srgb <108,  45,  4>/255 * Tone]
       [1.0 srgb <156,  72, 26>/255 * Tone]
     }

#declare Tone2 = Tone * 1.05;
#declare NR_woodmap3 =
     color_map {
       [0.0 srgb <121,  52, 13>/255 * Tone2]
       [0.1 srgb <142,  73, 18>/255 * Tone2]
       [0.3 srgb <184, 115, 48>/255 * Tone2]
       [0.8 srgb <157,  81, 23>/255 * Tone2]
       //[0.8 srgb <108,  45,  4>/255 * Tone2]
       [1.0 srgb <156,  72, 26>/255 * Tone2]
     }

#declare Tone3 = Tone * 0.95;
#declare NR_woodmap4 =
     color_map {
       [0.0 srgb <121,  52, 13>/255 * Tone3]
       [0.1 srgb <142,  73, 18>/255 * Tone3]
       [0.3 srgb <184, 115, 48>/255 * Tone3]
       [0.8 srgb <157,  81, 23>/255 * Tone3]
       //[0.8 srgb <108,  45,  4>/255 * Tone3]
       [1.0 srgb <156,  72, 26>/255 * Tone3]
     }

#declare FloorNormal = 0.8;

#declare NR_Wood =
texture {
   pigment {NR_wood_grain
     color_map {NR_woodmap2}
     ramp_wave
   }
   normal {
     function {NR_wood_normal(x,y,z).grey*FloorNormal
     }
   }
   finish {diffuse 0.6 specular 0.1 roughness 0.005}
}

#declare NR_Wood2 =
texture {
   pigment {NR_wood_grain
     color_map {NR_woodmap3}
     ramp_wave
   }
   normal {
     function {NR_wood_normal(x,y,z).grey*FloorNormal
     }
   }
   finish {diffuse 0.6 specular 0.1 roughness 0.005}
}

#declare NR_Wood3 =
texture {
   pigment {NR_wood_grain
     color_map {NR_woodmap4}
     ramp_wave
   }
   normal {
     function {NR_wood_normal(x,y,z).grey*FloorNormal
     }
   }
   finish {diffuse 0.6 specular 0.1 roughness 0.005}
}
//(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)
(o)
//(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)(o)
(o)

//#declare OakFloor = texture {NR_Wood scale 1 rotate <90, 0, 0>};

#declare HalfWidth    =  19.0;
#declare MortarScale  =  0.99;  //  0.995;
#declare TunnelRadius =  1.5;
#declare RoomWidth    =  9.0;
#declare PlankScale   =  1.78;

//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||

#declare FloorBorder =
union {
 #declare BorderSize = 2;
 //Left
 box {<-(RoomWidth*Feet)+0, -0.1, -9*Feet>, <-(RoomWidth*Feet)+(2*BorderSize),
2.0, 18*Feet> texture {NR_Wood2 scale 1 rotate <90, 0, 0>}}
 box {<-(RoomWidth*Feet)+(2*BorderSize), -0.1, -9*Feet>,
<-(RoomWidth*Feet)+(6*BorderSize), 2.0, 18*Feet> pigment {srgb <121,  52,
13>/255 * Tone3}}//texture {NR_Wood3 scale 1 rotate <90, 0, 0>}}

 #declare BlockRow = -(9*Feet);
 #declare Alternate = 1;
 #while (BlockRow < (18*Feet))
  #if (Alternate > 0)
   box {<-(RoomWidth*Feet)+(2*BorderSize+0.25), -0.1, BlockRow+0.25>,
<-(RoomWidth*Feet)+(6*BorderSize-0.25), 2.1, BlockRow+1.75> texture {NR_Wood
scale 1 rotate <90, 90, 0>}}
  #else
   box {<-(RoomWidth*Feet)+(2*BorderSize+0.25), -0.1, BlockRow+0.25>,
<-(RoomWidth*Feet)+(6*BorderSize-0.25), 2.1, BlockRow+1.75> texture {NR_Wood2
scale 1 rotate <90, 90, 0>}}
  #end
  #declare BlockRow = BlockRow + (1*BorderSize);
  #declare Alternate = -Alternate;
 #end
 box {<-(RoomWidth*Feet)+(6.0*BorderSize), -0.1, -9*Feet>,
<-(RoomWidth*Feet)+(7.5*BorderSize), 2.0, 18*Feet> texture {NR_Wood2 scale 1
rotate <90, 0, 0>}}
 box {<-(RoomWidth*Feet)+(7.5*BorderSize), -0.1, -9*Feet>,
<-(RoomWidth*Feet)+(8.0*BorderSize), 2.0, 18*Feet> pigment {srgb <121,  52,
13>/255 * Tone3}}

 // Right
 box {<(RoomWidth*Feet)-0, -0.1, -9*Feet>, <(RoomWidth*Feet)-(2*BorderSize),
2.0, 18*Feet> texture {NR_Wood2 scale 1 rotate <90, 0, 0>}}
 box {<(RoomWidth*Feet)-(2*BorderSize), -0.1, -9*Feet>,
<(RoomWidth*Feet)-(6*BorderSize), 2.0, 18*Feet> pigment {srgb <121,  52, 13>/255
* Tone3}}//texture {NR_Wood3 scale 1 rotate <90, 0, 0>}}

 #declare BlockRow = -(9*Feet);
 #declare Alternate = 1;
 #while (BlockRow < (18*Feet))
  #if (Alternate > 0)
   box {<(RoomWidth*Feet)-(2*BorderSize+0.25), -0.1, BlockRow+0.25>,
<(RoomWidth*Feet)-(6*BorderSize-0.25), 2.1, BlockRow+1.75> texture {NR_Wood
scale 1 rotate <90, 90, 0>}}
  #else
   box {<(RoomWidth*Feet)-(2*BorderSize+0.25), -0.1, BlockRow+0.25>,
<(RoomWidth*Feet)-(6*BorderSize-0.25), 2.1, BlockRow+1.75> texture {NR_Wood2
scale 1 rotate <90, 90, 0>}}
  #end
  #declare BlockRow = BlockRow + (1*BorderSize);
  #declare Alternate = -Alternate;
 #end
 box {<(RoomWidth*Feet)-(6*BorderSize), -0.1, -9*Feet>,
<(RoomWidth*Feet)-(7.5*BorderSize), 2.0, 18*Feet> texture {NR_Wood2 scale 1
rotate <90, 0, 0>}}
 box {<(RoomWidth*Feet)-(7.5*BorderSize), -0.1, -9*Feet>,
<(RoomWidth*Feet)-(8*BorderSize), 2.0, 18*Feet> pigment {srgb <121,  52, 13>/255
* Tone3}}

 //--------------------------------------------------------------------------------------------------------------------
-----------------------------------
 // Back
 box {<-(RoomWidth*Feet)+12, -0.1, 18*Feet-0>,
<(RoomWidth*Feet)-12, 2.0, 18*Feet-(2*BorderSize)> texture {NR_Wood2 scale 1
rotate <90, 90, 0>}}
 box {<-(RoomWidth*Feet)+12, -0.1, 18*Feet-(2*BorderSize)>,
<(RoomWidth*Feet)-12, 2.0, 18*Feet-(6*BorderSize)> pigment {srgb <121,  52,
13>/255 * Tone3}}
 #declare BlockRow = -(RoomWidth*Feet)+12;
 #declare Alternate = 1;
 #while (BlockRow < (RoomWidth*Feet)-12)
  #if (Alternate > 0)
   box {<BlockRow+0.25, -0.1, 18*Feet-(2*BorderSize+0.25)>, <BlockRow+1.75, 2.1,
18*Feet-(6*BorderSize)-0.25> texture {NR_Wood  scale 1 rotate <90, 0, 0>}}
  #else
   box {<BlockRow+0.25, -0.1, 18*Feet-(2*BorderSize+0.25)>, <BlockRow+1.75, 2.1,
18*Feet-(6*BorderSize)-0.25> texture {NR_Wood2 scale 1 rotate <90, 0, 0>}}
  #end
  #declare BlockRow = BlockRow + (1*BorderSize);
  #declare Alternate = -Alternate;
 #end
 box {<-(RoomWidth*Feet)+12, -0.1, 18*Feet-(6.0*BorderSize)>,
<(RoomWidth*Feet)-12, 2.0, 18*Feet-(7.5*BorderSize)> texture {NR_Wood2 scale 1
rotate <90, 90, 0>}}
 box {<-(RoomWidth*Feet)+12, -0.1, 18*Feet-(7.5*BorderSize)>,
<(RoomWidth*Feet)-12, 2.0, 18*Feet-(8*BorderSize)> pigment {srgb <121,  52,
13>/255 * Tone3}}

 // Front
 box {<-(RoomWidth*Feet)+12, -0.1, -9*Feet+0>, <(RoomWidth*Feet)-12, 2.0,
-9*Feet+4> texture {NR_Wood2 scale 1 rotate <90, 0, 0>}}
 box {<-(RoomWidth*Feet)+12, -0.1, -9*Feet+4>, <(RoomWidth*Feet)-12, 2.0,
-9*Feet+8> texture {NR_Wood3 scale 1 rotate <90, 0, 0>}}
 box {<-(RoomWidth*Feet)+12, -0.1, -9*Feet+8>, <(RoomWidth*Feet)-12, 2.0,
-9*Feet+12> texture {NR_Wood2 scale 1 rotate <90, 0, 0>}}

 translate y*18*Feet
}  // end union


//  Wood Floor building loop
#debug "Building Floor \n"

#declare BL   = seed (113);
#declare Rx   = seed (356);
#declare Ry   = seed (876);
#declare Rz   = seed (159);
#declare Flip = seed (542);
#declare Offset = 10*Feet;

#declare Floor =
union {
 #declare Row = -RoomWidth*Feet;
 #while (Row < RoomWidth*Feet)
  #debug concat("Building Row#", str(Row, 3, 0), " \n")
  //#debug concat("Center: <" vstr (3, Middle, ", ", 0, 1), ">, Radius:",
str(Radius, 3, 4), " \n")
  #declare OverallLength = 0;
  #declare BoardNo = 1;
  #while (OverallLength < 27)
   #declare RotY = SRand(BL)*5;
   #declare Randx = rand(Rx) * Offset;
   #declare Randy = rand(Ry) * Offset;
   #declare Randz = rand(Rz) * Offset;
   #declare BoardLength = (int(rand (BL)*4)+1)*3;
   #if (rand (Flip) > 0.5)
    #declare Amt = 180;
   #else
    #declare Amt = 0;
   #end

   #if (rand (Flip) < 0.3)
    #declare OakFloor = texture {NR_Wood scale 1 rotate <90, 0, 0>};
   #elseif (rand (Flip) > 0.6)
    #declare OakFloor = texture {NR_Wood2 scale 1 rotate <90, 0, 0>};
   #else
    #declare OakFloor = texture {NR_Wood3 scale 1 rotate <90, 0, 0>};
   #end

   #debug concat("Board#", str(BoardNo, 3, 0)," | Rotation:", str(Amt+RotY, 3,
0), " | Overall:", str(OverallLength, 3, 0)," \n")
   #declare FloorPlank = box {<Row, 0, (OverallLength-9)*Feet>, <Row+4 -
(rand(Rx)*(1/4)), 1.99, ((OverallLength-9+BoardLength)*Feet) -
(rand(Rz)*(1/8))>}
   object {FloorPlank texture {OakFloor rotate y*RotY translate <Randx, Randy,
Randz>} }
   #declare OverallLength = OverallLength + BoardLength;
   #declare BoardNo = BoardNo + 1;
  #end
 #declare Row = Row + 4;
 #end
 box {<-RoomWidth*Feet, (18*Feet), -9*Feet>, <RoomWidth*Feet, (18*Feet)+1.99,
18*Feet>
  texture {OakFloor} texture {pigment {rgbt <0, 0, 0, 0.4>}} }  //  Dark cracks
between floorboards

}  // end union




object {Floor translate y*18*Feet}

object {FloorBorder}


Post a reply to this message


Attachments:
Download 'woodfloor.png' (461 KB)

Preview of image 'woodfloor.png'
woodfloor.png


 

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