POV-Ray : Newsgroups : povray.advanced-users : Sharp shadows on meshes : Sharp shadows on meshes Server Time
30 Jul 2024 14:18:21 EDT (-0400)
  Sharp shadows on meshes  
From: Nieminen Mika
Date: 7 Jun 1999 03:18:37
Message: <375b724d@netplex.aussie.org>
Check the scene at the end of the article. It's a "cylinder" made of
smooth triangles.
  Why there's a sharp shadow instead of a smooth one? If you set AngStep
to 45 then there's a smooth shadow just like it should.

camera { location -z*50 look_at 0 angle 35 }
light_source { <100,100,-100> 1 }

mesh
{ #declare AngStep=90;
  #declare YStep=20;
  #declare Rad=5;
  #declare PosY=-10;
  #while(PosY<10)
    #declare Ang=0;
    #while(Ang<360)
      smooth_triangle
      { <sin(radians(Ang))*Rad, PosY, cos(radians(Ang))*Rad>,
	  <sin(radians(Ang)), 0, cos(radians(Ang))>,
	<sin(radians(Ang))*Rad, PosY+YStep, cos(radians(Ang))*Rad>,
	  <sin(radians(Ang)), 0, cos(radians(Ang))>,
        <sin(radians(Ang+AngStep))*Rad, PosY+YStep, cos(radians(Ang+AngStep))*Rad>,
	  <sin(radians(Ang+AngStep)), 0, cos(radians(Ang+AngStep))>
      }
      smooth_triangle
      { <sin(radians(Ang))*Rad, PosY, cos(radians(Ang))*Rad>,
	  <sin(radians(Ang)), 0, cos(radians(Ang))>,
        <sin(radians(Ang+AngStep))*Rad, PosY+YStep, cos(radians(Ang+AngStep))*Rad>,
	  <sin(radians(Ang+AngStep)), 0, cos(radians(Ang+AngStep))>,
	<sin(radians(Ang+AngStep))*Rad, PosY, cos(radians(Ang+AngStep))*Rad>,
	  <sin(radians(Ang+AngStep)), 0, cos(radians(Ang+AngStep))>
      }
      #declare Ang=Ang+AngStep;
    #end
    #declare PosY=PosY+YStep;
  #end
  pigment { rgb x } finish { specular .5 }
}


-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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