POV-Ray : Newsgroups : povray.text.tutorials : S-Triangle normal help : Re: S-Triangle normal help Server Time
2 May 2024 14:23:02 EDT (-0400)
  Re: S-Triangle normal help  
From: Nieminen Mika
Date: 11 Jun 1999 03:56:43
Message: <3760c13b@news.povray.org>
Phil Clute <pcl### [at] tiacnet> wrote:
: smooth_triangle{
: 	< 0, 0, 0> < .5, .5, .5>  // <Vertex1>  <SurfaceNormal1>
: 	< 1, 0, 0> < .5, .5, .5>  // <Vertex2>  <SurfaceNormal2>
: 	< 0, 1, 0> < .5, .5, .5>  // <Vertex3>  <SurfaceNormal3>
: 	pigment{Red}
: }

  Your triangle is placed in the x-y-plane and your normal vectors are
pointing to the <1,1,1>-direction (ie. imagine the line which goes through
the points <0,0,0> and <1,1,1>).
  If you want a regular triangle and since your triangle is in the
x-y-plane, the normal vectors should point to the negative z direction,
which is the perpendicular to that plane, ie:

smooth_triangle{
	< 0, 0, 0> < 0,0,-1>  // <Vertex1>  <SurfaceNormal1>
	< 1, 0, 0> < 0,0,-1>  // <Vertex2>  <SurfaceNormal2>
	< 0, 1, 0> < 0,0,-1>  // <Vertex3>  <SurfaceNormal3>
	pigment{Red}
}

  Note that the direction of the normal vectors is independent of the
location of the triangle as long as they point to the perpendicular
direction. For example, this is the equivalent triangle located in another
position:

smooth_triangle{
	< 10, 20, 30> < 0,0,-1>  // <Vertex1>  <SurfaceNormal1>
	< 11, 20, 30> < 0,0,-1>  // <Vertex2>  <SurfaceNormal2>
	< 10, 21, 30> < 0,0,-1>  // <Vertex3>  <SurfaceNormal3>
	pigment{Red}
}

-- 
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.