POV-Ray : Newsgroups : povray.newusers : tile texture : Re: tile texture Server Time
5 Sep 2024 08:16:17 EDT (-0400)
  Re: tile texture  
From: John VanSickle
Date: 19 Apr 2001 16:28:13
Message: <3ADF4B20.9384CEA6@erols.com>
Sander wrote:
> 
> Who can help me with the building of a texture (macro) that has the
> look of the image in pbi? I have not the slightest idea where to
> begin... :(

Since you and I share the same birthday, I'll help you.
A test picture is posted to p.b.i.

Use the macro this way:

object { MyObject
  texture {
    Herringbone(BrickTexture,MortarTexture,MortarWidth)
  }
}

Regards,
John
-- 
ICQ: 46085459

// MACRO CODE FOLLOWS

#macro Herringbone(tS,tM,sW)
// tS is the brick texture
// tM is the texture for the stuff between the bricks
// sW is the width of the mortar

#local tA=texture { gradient x
  texture_map { [.50+sW/2 tM][.50+sW/2 tS][.75-sW/2 tS][.75-sW/2 tM]}
}

#local tB=texture { gradient x
  texture_map { [sW/2 tM][sW/2 tS][.50-sW/2 tS][.50-sW/2 tM]
    [.50+sW/2 tM][.50+sW/2 tS][.75-sW/2 tS][.75-sW/2 tM]
    [.75+sW/2 tM][.75+sW/2 tS][1-sW/2 tS][1-sW/2 tM]
  }
}

#local tC=texture { gradient x
  texture_map { [.75+sW/2 tM][.75+sW/2 tS][1-sW/2 tS][1-sW/2 tM]}
}

#local tD=texture { gradient x
  texture_map { [sW/2 tM][sW/2 tS][.25-sW/2 tS][.25-sW/2 tM]
    [.25+sW/2 tM][.25+sW/2 tS][.75-sW/2 tS][.75-sW/2 tM]
    [.75+sW/2 tM][.75+sW/2 tS][1-sW/2 tS][1-sW/2 tM]
  }
}

#local tE=texture { gradient x
  texture_map { [sW/2 tM][sW/2 tS][.25-sW/2 tS][.25-sW/2 tM]}
}

#local tF=texture { gradient x
  texture_map { [sW/2 tM][sW/2 tS][.25-sW/2 tS][.25-sW/2 tM]
    [.25+sW/2 tM][.25+sW/2 tS][.50-sW/2 tS][.50-sW/2 tM]
    [.50+sW/2 tM][.50+sW/2 tS][1-sW/2 tS][1-sW/2 tM]
  }
}

#local tG=texture { gradient x
  texture_map { [.25+sW/2 tM][.25+sW/2 tS][.50-sW/2 tS][.50-sW/2 tM]}
}

#local tH=texture { gradient x
  texture_map { [.25-sW/2 tS][.25-sW/2 tM]
    [.25+sW/2 tM][.25+sW/2 tS][.50-sW/2 tS][.50-sW/2 tM]
    [.50+sW/2 tM][.50+sW/2 tS][.75-sW/2 tS][.75-sW/2 tM]
    [.75+sW/2 tM][.75+sW/2 tS]
  }
}

gradient z
  texture_map {
    [sW/2 tA][sW/2 tB]
    [.25-sW/2 tB][.25-sW/2 tC]
    [.25+sW/2 tC][.25+sW/2 tD]
    [.50-sW/2 tD][.50-sW/2 tE]
    [.50+sW/2 tE][.50+sW/2 tF]
    [.75-sW/2 tF][.75-sW/2 tG]
    [.75+sW/2 tG][.75+sW/2 tH]
    [1-sW/2   tH][1-sW/2   tA]
  }

#end

// END OF MACRO CODE


Post a reply to this message

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