POV-Ray : Newsgroups : povray.binaries.images : My try at Genoba's pov filter effects [~135KB Jpg] : My try at Genoba's pov filter effects [~135KB Jpg] Server Time
14 Aug 2024 11:20:54 EDT (-0400)
  My try at Genoba's pov filter effects [~135KB Jpg]  
From: hughes, b 
Date: 23 Oct 2002 23:26:53
Message: <3db7687d@news.povray.org>
Anybody done this kind yet? It's a luminosity-based filter, taking the gray
dot operator from the eval_pigment function. The objects used are just the
common primitives which looked good for going dark to light. I modifying the
one called PovRay. I call it Hughes partly out of vanity and partly because
"Custom" didn't sound good or unique enough.
Here's the script so you can mess with it if you want. Note that a added a
way to vary the depth, and I used highlighting in the texture. I love this
kind of thing, thanks again Genoba!

/* begin Hughes */
#macro Hughes (pigm, strokesX, strokesY, depthZ)
 #local widthX = 4/3;
 #local heightY = 1;
 #local cntX = 0;
 #local cntY = 0;
 #local lseed = seed(1000);
 #local incrX = widthX/strokesX;
 #local incrY = heightY/strokesY;

 #declare Stroke1 = box { -1, 1 scale 0.35 rotate <-45,45,-90> no_shadow };
 #declare Stroke2 = torus { 0.3, 0.2 rotate x*90 scale <1, 1, 1>
no_shadow };
 #declare Stroke3 = cone {  <0, -0.5, 0>, 0.5, <0, 0.5, 0>, 0 scale <1, 1,
1> no_shadow };
 #declare Stroke4 = cone { <-0.5, 0, 0>, 0.5, <0.5, 0, 0>, 0 scale <1, 1, 1>
no_shadow };
 #declare Stroke5 = lathe { cubic_spline 6, <-0.25,-0.25>, <0,0>,
<0.5,0.25>, <0.25,0.67>, <0.33,1>, <0.5,1.25> translate -y/2 scale <1, 1, 1>
no_shadow };
 #declare Stroke6 = sor { 6, <0,0>, <0,0>, <0.5,0.25>, <0.25,0.5>, <0.33,1>,
<0.33,1> translate -y/2 rotate -90*z scale <1, 1, 1> no_shadow };
 #declare Stroke7 = sphere { 0, 0.5 scale <1, 1, 1> no_shadow };
 #declare Stroke8 = cylinder { <-0.5, 0, 0>, <0.5, 0, 0>, 0.5 scale <1, 1,
1> no_shadow };
 #declare Stroke9 = cylinder { <0, -0.5, 0>, <0, 0.5, 0>, 0.5 scale <1, 1,
1> no_shadow };
 #declare Stroke10 = superellipsoid { <0.6,0.6> scale <1, 1, 1>/2
no_shadow };

 #while(cntX < strokesX)
  #local cntY = 0;
  #while(cntY < strokesY)
   #declare currentPoint = <incrX*cntX, incrY*cntY, 0>;

   #declare P = eval_pigment(pigm, <currentPoint.x, currentPoint.y, 0>);

      #local T = texture{pigment{P} finish{ambient 0.2 diffuse 0.7 phong 0.1
 phong_size 1 specular 0.1 roughness 1}};

   #declare P2 = P; // just to separate this from the other

// #debug concat("Gray value is ",str(P2.gray,0,-1),"\n")

      #local lnum = P2.gray; // base objects on gray level of image (.red,
.green, .blue possible too)

            #if(lnum <= 0.1)
                #local CurrentStroke = Stroke1;
            #end

            #if(lnum <= 0.2 & lnum > 0.1)
                #local CurrentStroke = Stroke2;
            #end

            #if(lnum <= 0.3 & lnum > 0.2)
                #local CurrentStroke = Stroke3;
            #end

            #if(lnum <= 0.4 & lnum > 0.3)
                #local CurrentStroke = Stroke4;
            #end

            #if(lnum <= 0.5 & lnum > 0.4)
                #local CurrentStroke = Stroke5;
            #end

            #if(lnum <= 0.6 & lnum > 0.5)
                #local CurrentStroke = Stroke6;
            #end

            #if(lnum <= 0.7 & lnum > 0.6)
                #local CurrentStroke = Stroke7;
            #end

            #if(lnum <= 0.8 & lnum > 0.7)
                #local CurrentStroke = Stroke8;
            #end

            #if(lnum <= 0.9 & lnum > 0.8)
                #local CurrentStroke = Stroke9;
            #end

            #if(lnum <= 1 & lnum > 0.9)
                #local CurrentStroke = Stroke10;
            #end

      object {
       CurrentStroke
       scale <1,1,depthZ>
       texture{T}
    scale incrX
    translate<incrX/2, incrY/2, 0>
    translate<currentPoint.x, currentPoint.y, 0>
   }
   #local cntY = cntY + 1;
  #end
  #local cntX = cntX + 1;
 #end
#end
/* end custom */

// usage
Hughes(80,60,0.5)


Post a reply to this message


Attachments:
Download 'hughes_50th_anniversary.JPG' (98 KB)

Preview of image 'hughes_50th_anniversary.JPG'
hughes_50th_anniversary.JPG


 

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