POV-Ray : Newsgroups : povray.binaries.images : An image... : Re: An image... Server Time
15 Aug 2024 10:23:10 EDT (-0400)
  Re: An image...  
From: Slime
Date: 30 Jun 2002 18:52:01
Message: <3d1f8b91@news.povray.org>
You can also use this function I developed that's handy for checker-based
textures:

#declare smoothcheckerbasis = function (x,y,z,allfloors,xv,yv,zv) {
 select(allfloors-floor(allfloors/2)*2,
  0,
  max(xv-.5,yv-.5,zv-.5, .5-xv,.5-yv,.5-zv),
  min(xv+.5,yv+.5,zv+.5, 1.5-xv,1.5-yv,1.5-zv)
 )
}
#declare smoothchecker = function (x,y,z) {

smoothcheckerbasis(x,y,z,floor(x)+floor(y)+floor(z),x-floor(x),y-floor(y),z-
floor(z))
}


Use it like:

function {smoothchecker(x,y+.5,z)}

(translated by .5 units to show the interesting part on the X-Z plane)

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

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