POV-Ray : Newsgroups : povray.text.scene-files : Tiling again... Server Time
22 Dec 2024 09:52:15 EST (-0500)
  Tiling again... (Message 1 to 2 of 2)  
From: Rarius
Subject: Tiling again...
Date: 3 May 2005 18:26:48
Message: <4277faa8$1@news.povray.org>
I need to create a large number of tiles and I really CANNOT do it with a 
macro, I need to create a pattern that I can reuse.

The pattern value needs to be based on a square grid like the cells pattern, 
but the value needs to decrease from the centre of each cell towards the 
edges.

I think there is a pattern modifier I can apply to the cells pattern to do 
this but I cannot remember/find out what it is.

Help!

Rarius
rar### [at] rariuscouk


Post a reply to this message

From: Mike Williams
Subject: Re: Tiling again...
Date: 3 May 2005 21:35:14
Message: <aVQ1aBAFbCeCFwAP@econym.demon.co.uk>
Wasn't it Rarius who wrote:
> I need to create a large number of tiles and I really CANNOT do it with a 
>macro, I need to create a pattern that I can reuse.
>
>The pattern value needs to be based on a square grid like the cells pattern, 
>but the value needs to decrease from the centre of each cell towards the 
>edges.
>
>I think there is a pattern modifier I can apply to the cells pattern to do 
>this but I cannot remember/find out what it is.
>
>Help!

I would suggest a pigment function, something like this:

  #declare F=function{pigment {cells}}
  pigment {function {
    ((x-floor(x))*(1-x+floor(x))
    +(y-floor(y))*(1-y+floor(y))
    +(z-floor(z))*(1-z+floor(z)))
    *0.66  + F(x,y,z).x * 0.5
    }
  }

Adjust the "0.66" and the "0.5" to vary the strength of the "cells"
effect, being careful to ensure that the total can't end up greater than
one. [The value of the x-floor to z-floor stuff ranges from 0.0 to 0.75,
and F(x,y,z).x ranges from 0.0 to 1.0]

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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