POV-Ray : Newsgroups : povray.binaries.scene-files : Artistic half-tone or drawing with pens Server Time
2 Sep 2024 12:13:27 EDT (-0400)
  Artistic half-tone or drawing with pens (Message 1 to 4 of 4)  
From: Kari Kivisalo
Subject: Artistic half-tone or drawing with pens
Date: 6 Feb 2002 03:51:34
Message: <3C60EED6.D18A8544@engineer.com>
pic.jpg is gray scale image and hf.jpg is the same but blurred.

#version 3.5;

camera {
  orthographic
  location <0,0,-1>   
  look_at  <0,0,0>
  right 1*x 
  up 1*y
}

background{rgb 1}

#declare Mark=
  cylinder{-0.5*x,0.5*x,0.5 pigment{rgb<0,0,0>}
  finish{ambient 0 diffuse 0}}

#declare V=
  function{
    pigment{
      image_map{jpeg "pic.jpg" interpolate 2}
      translate -0.5
    }
  }

#declare HF=
height_field{jpeg "hf.jpg" translate<-0.5,-1,-0.5> rotate -90*x
  pigment{gradient -z} finish{diffuse 0 ambient 1}
  }


#declare Normal=<0,0,0>;
#declare Div=0.01;
#declare S=seed(4);

#declare X=-0.5;#while(X<0.5)
  #declare Y=-0.5;#while(Y<0.5)
    #declare tmp=trace(HF, <X,Y,-2>, z, Normal);
    #declare n1=vnormalize(Normal);
    #declare Normal=n1;
    #declare I=max((1-(V(X,Y,0).red*0.6)),0)^5;
    #if(sqrt((Normal.x)^2+(Normal.y)^2)>0.0001)
      object{
         Mark scale<Div*4*(1-I/2),Div*I,Div*I>+Div/100
         rotate z*(degrees(atan2(Normal.y,Normal.x))+90+10-rand(S)*20)
         translate<X+Div/2-rand(S)*Div,Y+Div/2-rand(S)*Div,X+Y+1>
      }
    #else
       object{
         Mark scale<Div*4*(1-I/2),Div*I,Div*I>+Div/100
         rotate z*360*rand(S)
         translate<X+Div/2-rand(S)*Div,Y+Div/2-rand(S)*Div,X+Y+1>}
    #end
  #declare Y=Y+Div;#end
#declare X=X+Div;#end


_____________
Kari Kivisalo


Post a reply to this message

From: Gleb
Subject: Re: Artistic half-tone or drawing with pens
Date: 6 Feb 2002 04:39:45
Message: <3c60f9e1$1@news.povray.org>
Interesting. However, I've got an error message with the test image:

Parse Error: sqrt of negative number -1.#IND00
(POV Ray 3.5b10 win2K)
but after this minor change:

    //#if(sqrt((Normal.x)^2+(Normal.y)^2)>0.0001)
    #if(((Normal.x)^2+(Normal.y)^2)>0.01)

it is OK

Thank you for sharing your ideas.

Gleb


"Kari Kivisalo" <ray### [at] engineercom> wrote in message
news:3C60EED6.D18A8544@engineer.com...


Post a reply to this message

From:
Subject: Re: Artistic half-tone or drawing with pens
Date: 6 Feb 2002 04:55:34
Message: <i7v16uco46o5vsul24jo06asan9qitpjso@4ax.com>
On Wed, 6 Feb 2002 09:39:45 -0000, "Gleb" <gk1### [at] sotonacuk> wrote:
>    //#if(sqrt((Normal.x)^2+(Normal.y)^2)>0.0001)
>    #if(((Normal.x)^2+(Normal.y)^2)>0.01)
>
> it is OK

afaik you have moved comma in wrong direction
(or it was intentional increase of epsilon)

ABX


Post a reply to this message

From: Gleb
Subject: Re: Artistic half-tone or drawing with pens
Date: 6 Feb 2002 05:20:31
Message: <3c61036f$1@news.povray.org>
"W?odzimierz ABX Skiba" <abx### [at] babilonorg> wrote in message
news:i7v16uco46o5vsul24jo06asan9qitpjso@4ax.com...

> afaik you have moved comma in wrong direction
> (or it was intentional increase of epsilon)
Correct.
#if(((Normal.x)^2+(Normal.y)^2)>0.00000001)

works OK, too


Post a reply to this message

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