POV-Ray : Newsgroups : povray.newusers : Weird side-effect of wrinkles in a normal... : Re: Weird side-effect of wrinkles in a normal... Server Time
29 Jul 2024 18:22:11 EDT (-0400)
  Re: Weird side-effect of wrinkles in a normal...  
From: Mike Williams
Date: 9 May 2005 03:13:50
Message: <0H2e+AAb1wfCFwte@econym.demon.co.uk>
Wasn't it JYR who wrote:
>Hi everybody!
>I attempted to use "wrinkles" in a "normal" statement to give a rough finish
>to the outer walls of some imaginary building. It is constructed
>recursively and implies that its modules be rotated by 0, 90, 180, 270
>degrees around the y-axis to take place at each corner. Now, i noticed a
>slight difference in the appearance of the different modules. Investigating
>further, i gathered the following minimal source to demonstrate a strange
>behaviour...

I don't know why it happens, but if you're interested in a workround,
it's possible to arrange rotate the normals in the opposite direction to
the rotation of the quadrants, so that the cubes rotate but the wrinkles
don't.


#version 3.6;

global_settings {assumed_gamma 1.0}


#declare degre=3;
#declare pdd=pow(2,degre);

camera {
    location  <-.25*pdd, .85*pdd, -1.6*pdd>
    look_at   (2-pdd)*y
}

light_source {<-500, 260, -240> rgb 1}

#macro cell (n,Rot)
    box {-n, n}
    texture {
        pigment {rgb 1}
        normal {wrinkles  scale .2 rotate -Rot*90*y}
    }
#end //macro cell (n)

#macro pyramide (n,Rot)
    #if (n=1)
        object {cell (1,Rot)}
    #else
        union {
            #local quadrant=0;
            #while (quadrant<4)
                object {
                    pyramide (n-1,Rot+quadrant)
                    translate -pow(2,n-1)/2
                    rotate quadrant*90*y
                }
                #local quadrant=quadrant+1;
            #end //while
        }
    #end //if
#end //macro pyramide (n)

object {pyramide (degre,0)}




-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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