POV-Ray : Newsgroups : povray.binaries.images : random-colored BRICKS : Re: random-colored BRICKS Server Time
26 Apr 2024 07:38:00 EDT (-0400)
  Re: random-colored BRICKS  
From: Bill Pragnell
Date: 18 Apr 2018 19:00:01
Message: <web.5ad7cc2995b142bd1b6c6b3a0@news.povray.org>
This is fun! I always meant to make some random bricks, so I've just had a go
myself. I ended up with almost exactly what you've got (more or less) which is
good. However, I don't think you need the oversized offset value - just 1.5 in x
and z is fine.

I've boiled it down a little. Here's a macro to insert a pigment - I went with
the same principle of using the brick pattern for the mortar and the cells
pattern for the bricks themselves.

(BrickSize is a vector describing the brick dimensions, BaseCol and MortarCol
are colour vectors, and MortarThickness is just the mortar float value.)


#macro RandBrick(BrickSize, BaseCol, MortarCol, MortarThickness)
 #local RBrick = pigment {
  cells
  color_map { [0 rgb BaseCol] [1 rgb 0.25*BaseCol] }
  translate z*0.5
  warp { repeat y offset <1.5, 0, 1.5> }
  scale BrickSize
 }
 pigment {
  brick
  pigment { rgb MortarCol },
  pigment { RBrick }
  brick_size BrickSize
  mortar MortarThickness
 }
#end


Post a reply to this message

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