POV-Ray : Newsgroups : povray.general : Need for new pattern - cubediv? : Re: Need for new pattern - cubediv? Server Time
31 Jul 2024 20:24:43 EDT (-0400)
  Re: Need for new pattern - cubediv?  
From: Raf256
Date: 21 Sep 2006 02:50:48
Message: <45123647@news.povray.org>
Raf256 <45122a6d@news.povray.org> Thursday 21 of September 2006 08:00


> Imho the solution would be a pattern returning one of 6 values (so like 0,
> 1/6, 2/6 etc) basing on the direction.
> If (x>y) && (x>z) then the main direction is +x
> If (x<y) && (x<z) then the main direction is -x
> end so on.

So far I think I was able to work around using function...

  #declare choose_texture = function(x,y,z) {
    (
    ((y>=abs(x))&(y>=abs(z)))*1+
    ((x>=abs(y))&(x>=abs(z)))*2+
    ((z>=abs(x))&(z>=abs(y)))*3+

    ((-y>=abs(x))&(-y>=abs(z)))*4+
    ((-x>=abs(y))&(-x>=abs(z)))*5+
    ((-z>=abs(x))&(-z>=abs(y)))*6
    )/6
  }


-- 

Cytat tygodnia:


Post a reply to this message

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