POV-Ray : Newsgroups : povray.binaries.images : An experiment in monochrome : Re: An experiment in monochrome Server Time
23 Apr 2024 20:44:06 EDT (-0400)
  Re: An experiment in monochrome  
From: m@b
Date: 8 Jun 2021 05:32:15
Message: <60bf391f$1@news.povray.org>
On 08/06/2021 4:24 pm, Mr wrote:
> "m@b" <sai### [at] googlemailcom> wrote:
>> Trying to emulate mechanical shading.
>>
>> m@
> 
> Nice!
> How does it work?
> 

The image is put into a function:

#declare MyTesti = function
{ pigment
   { image_map
     { "My image.png"  map_type 0
       once
     }
     // scale <1,1,1>
   } 

}

(I am not sure where this function came from - I used it many years ago 
in another project.)

These 4 functionas contain the information for each colour:

#declare TestR = function {MyTesti(x,y,z).red}      // Extract colours
#declare TestG = function {MyTesti(x,y,z).green}
#declare TestB = function {MyTesti(x,y,z).blue}
#declare TestK = function {MyTesti(x,y,z).grey}

Each point on the image is interrogated and a sphere is drawn.
The sphere is scaled by a constant in X and by brightness in Y.
The sphere is rotated depending on the predominant colour: R, G, B or 
neutral. (Rotation must be a multiple of 45 degrees or the spheres don't 
join up to make a line.)
The sphere is scaled to match the aspect of the input image.

I can post the code, but it needs to be cleaned up first.

m@


Post a reply to this message

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