POV-Ray : Newsgroups : povray.newusers : How to set the texture of the tiles like in this post? : Re: How to set the texture of the tiles like in this post? Server Time
18 Apr 2024 16:11:47 EDT (-0400)
  Re: How to set the texture of the tiles like in this post?  
From: clipka
Date: 8 Feb 2018 04:31:17
Message: <5a7c18e5$1@news.povray.org>
Am 08.02.2018 um 06:39 schrieb mathzhaoliang:

> Hi clipka: I have just realized you are the author of the images in that thread.
> Could you share the code that how you set the texture of the floor tiles?
> Thanks!

I had to dig a little, but here it is:


#declare TILING = 27;
#declare N      = 2;

#declare Nm = normal {
  tiling TILING
  slope_map {
    #for (I,0,N-1)
      [ (I + 0.0)/N <1, 0> ]
      [ (I + 0.8)/N <1, 0> ]
      [ (I + 1.0)/N <0,-1> ]
      [ (I + 1.0)/N <0, 0> ]
    #end
  }
}

#declare Fn = finish {
  ambient 0.1
  diffuse albedo 0.5
  specular albedo 0.3 roughness 0.001
  reflection { 0.3 }
}

#declare Tx1 = texture {
  pigment { color rgb 0.5 }
  finish { Fn }
  normal { Nm }
}

#declare Tx2 = texture {
  pigment { color rgb 0.5 }
  finish { Fn }
  normal { Nm }
}

#declare Tx3 = texture {
  pigment { color rgb 0.5 }
  finish { Fn }
  normal { Nm }
}

#declare Tx4 = texture {
  pigment { color blue 0.5 }
  finish { Fn }
  normal { Nm }
}

#declare Tx5 = texture {
  pigment { color blue 0.5 }
  finish { Fn }
  normal { Nm }
}

#declare Tx6 = texture {
  pigment { color blue 0.5 }
  finish { Fn }
  normal { Nm }
}

#if (N = 2)
  #declare Tx2 = texture { Tx6 }
#end

#declare TxGap = texture {
  pigment { color rgb 0.1 }
  normal { bumps 0.5 scale 0.001 }
}

plane{y,0
  texture{
    tiling TILING
    texture_map {
      [ (0 + 0.00)/N Tx1 ]
      [ (0 + 0.95)/N Tx1 ]
      [ (0 + 0.95)/N TxGap ]
      [ (0 + 1.00)/N TxGap ]
      [ (1 + 0.00)/N Tx2 ]
      [ (1 + 0.95)/N Tx2 ]
      [ (1 + 0.95)/N TxGap ]
      [ (1 + 1.00)/N TxGap ]
      [ (2 + 0.00)/N Tx3 ]
      [ (2 + 0.95)/N Tx3 ]
      [ (2 + 0.95)/N TxGap ]
      [ (2 + 1.00)/N TxGap ]
      [ (3 + 0.00)/N Tx4 ]
      [ (3 + 0.95)/N Tx4 ]
      [ (3 + 0.95)/N TxGap ]
      [ (3 + 1.00)/N TxGap ]
      [ (4 + 0.00)/N Tx5 ]
      [ (4 + 0.95)/N Tx5 ]
      [ (4 + 0.95)/N TxGap ]
      [ (4 + 1.00)/N TxGap ]
      [ (5 + 0.00)/N Tx6 ]
      [ (5 + 0.95)/N Tx6 ]
      [ (5 + 0.95)/N TxGap ]
      [ (5 + 1.00)/N TxGap ]
    }
  }
}


Post a reply to this message

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