POV-Ray : Newsgroups : povray.advanced-users : Re: What is the frontside of a triangle? : Re: What is the frontside of a triangle? Server Time
29 Jul 2024 00:30:10 EDT (-0400)
  Re: What is the frontside of a triangle?  
From: Tim Nikias v2 0
Date: 8 Jul 2003 12:56:00
Message: <3f0af7a0@news.povray.org>
The problem is how you define the triangle. Normally,
a triangle's corners are given in clockwise-direction
(or counterclockwise). The corners can then just be
fed into a little algorithm calculating the surface-normal,
and thus determine its front- and backside.
Normally, a program will require either clockwise or
counter-clockwise corners. I'm not too sure which approach
POV-Ray takes, but you could just experiment and find
out yourself.

Regards,
Tim

-- 
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights


> Hi,
>
> can anyone tell me how POV decide what the front or back side
> of a triangle is?
> I can't figure it out, because if you try the following code it changes
> every time.
> If you changes the triangle, then everything changes again.
>
> #declare TR1 =
> //  triangle {<0.1,0,0>, <0.1,1,0>, <1,1,-1>  // try this also
>   triangle {<0.1,0,0>, <0.1,1,0>, <1,1,1>
>     texture {
>       pigment { rgb <.2, .2, .8> }
>       finish {ambient 1} }
>    interior_texture {
>       pigment { rgb <.8, .8, .2> }
>       finish {ambient 1} }
>   }
>
> object { TR1 }
> object { TR1 rotate <0,180,0> }
> object { TR1 rotate <0,180,0> translate <0,1,0> }
> object { TR1 rotate <0,180,0> translate <-1,0,0> }
> object { TR1 translate <0,-1,0> }
> object { TR1 translate <0,-1,0> rotate <0,180,0> }
> object { TR1 translate <0,-1,0> rotate <0,180,0>
>              translate <-1,0,0> }
> object { TR1 translate <0,-1,0> rotate <0,180,0>
>              translate <-1,-1,0> rotate <0,180,0> }
>
> camera { location <0.0, 0.0, -5.0>
>          right x*image_width/image_height
>          look_at   <0.0, 0.0,  0.0> }
>
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.495 / Virus Database: 294 - Release Date: 30.06.2003


Post a reply to this message

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