POV-Ray : Newsgroups : povray.general : finite texture : Re: finite texture Server Time
2 Aug 2024 04:25:44 EDT (-0400)
  Re: finite texture  
From: bmc
Date: 12 Apr 2005 21:10:00
Message: <web.425c7072e46da0b4144b13b30@news.povray.org>
a small update after finding the original german thread:

extension of the functions to 3d

// position "inside" the stone
#declare fn_brick_x = function { x - floor(y)*brick_length/2 - floor((x -
floor(y)*brick_length/2)/brick_length)*brick_length }
#declare fn_brick_y = function { y - floor(y) }
#declare fn_brick_z = function { z - floor(y)*brick_length/2 - floor((z -
floor(y)*brick_length/2)/brick_length)*brick_length }
// middle point of the stone
#declare fn_brick_n_x = function { floor((x -
floor(y)*brick_length/2)/brick_length)*brick_length }
#declare fn_brick_n_y = function { floor(y) }
#declare fn_brick_n_z = function { floor((z -
floor(y)*brick_length/2)/brick_length)*brick_length }

// mask for motar
#declare fn_mortar = function {
  max (
    select(x-brick_d,1,select(brick_length-brick_d-x,1,0)),
    select(z-brick_d,1,select(brick_length-brick_d-z,1,0)),
    select(y-brick_d,1,select(1-brick_d-y,1,0))
  )
}

this will probably lead to a lot of motar on the surface. a translation of
the texture should help in that case.
e.g.
translate <.25,0,.25>


Post a reply to this message

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