POV-Ray : Newsgroups : povray.general : How to define the normal on a single triangle? (new pov-ray user) : Re: How to define the normal on a single triangle? (new pov-ray user) Server Time
2 Aug 2024 20:21:45 EDT (-0400)
  Re: How to define the normal on a single triangle? (new pov-ray user)  
From: Warp
Date: 23 Jul 2004 08:01:48
Message: <4100fe2c@news.povray.org>
Impress <yha### [at] nospamhotmailcom> wrote:
> I mean, if by
> computing the normal length and check if it's zero or greater, the surface
> receive the texture, otherwise interior_texture...?

  AFAIK, triangles are assigned a normal vector at parse time.
  At render time it's enough to check the sign of the dot-product of the
incoming ray and the normal vector to see if the incoming ray hit the
inner or the outer side of the triangle.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

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