POV-Ray : Newsgroups : povray.binaries.images : random-colored BRICKS : random-colored BRICKS Server Time
25 Apr 2024 02:53:19 EDT (-0400)
  random-colored BRICKS  
From: Kenneth
Date: 17 Apr 2018 13:55:07
Message: <web.5ad633941828641ca47873e10@news.povray.org>
I just spent four days probably 're-inventing the wheel'; but  I wanted to
investigate the behavior of the brick pattern, when using warp{repeat...} with
an embedded cells pattern.

The recent posts about making bricks and wood planking got me to thinking about
this. As-is, the brick pattern's brick color is all the same (i.e., the same
color is repeated brick after brick.)  By using the cells pattern in it, and a
warp{repeat..} statement, random-colored bricks can be made. But the idea can be
applied to other pigments/textures, like wood. And normals.

I'm not totally sure what warp{repeat} does to an already-random cells pattern,
but the result looks satisfactory. The nice thing is, the brick's 'mortar' color
(or user-imposed pattern for that) is NOT repeated, but is 'global/continuous',
thanks to the brick pattern's own underlying code.

As an experiment, I animated part of the warp 'repeat' direction...
                warp{repeat y offset <frame_number + .5, 0 .5>}
.... to get a clue to its visual behavior, at least on the x/y plane. The bottom
row of bricks does NOT change; the 2nd row in y moves 'one brick' to the left
per frame_number; the 3rd row moves two bricks to the left, the fourth row moves
three bricks; and so on. This is probably expected behavior; but to try and
eliminate such an obvious 'repeat' pattern, I used...
    warp{repeat y offset <400 + .5,0,400 + .5>  // try <.5,0,.5> instead
         along with...
                translate -200*y (slightly more/less)

I *think* that the large repeat-y offsets will choose each new 'brick cell'
after skipping 400 units in x and z, rather than just using the next natural
cell along those axes.  But it may not be necessary anyway because the cells
pattern is already random! The added translation is simply to push the lower
brick rows-- with their obvious 'small' repeat movements-- way down into space,
and to instead use the cells pattern where each new brick row (starting at y=0)
shifts by at least 200 units to the left, compared to its lower neighbor. Again,
probably unnecessary.

Try applying the code to the distant z-plane first, to see its random
appearance.


Post a reply to this message


Attachments:
Download 'multicolored_bricks_1.jpg' (1101 KB)

Preview of image 'multicolored_bricks_1.jpg'
multicolored_bricks_1.jpg


 

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