POV-Ray : Newsgroups : povray.newusers : Normals in Pov Server Time
5 Sep 2024 16:19:03 EDT (-0400)
  Normals in Pov (Message 1 to 10 of 16)  
Goto Latest 10 Messages Next 6 Messages >>>
From: Jason Miller
Subject: Normals in Pov
Date: 17 Jul 2000 02:13:43
Message: <3972a417$1@news.povray.org>
Does Povray care about the winding of a mesh?  As in, does it use 1 sided or
2 sided polygons?  If it uses one sided, how can this be set to 2 sided?

Thanks,
    Jason


Post a reply to this message

From: Warp
Subject: Re: Normals in Pov
Date: 17 Jul 2000 09:45:33
Message: <39730dfc@news.povray.org>
Jason Miller <jas### [at] pinheirotcimetnet> wrote:
: Does Povray care about the winding of a mesh?  As in, does it use 1 sided or
: 2 sided polygons?  If it uses one sided, how can this be set to 2 sided?

  I suppose that a 1-sided polygon is (like, for example, in OpenGL) a polygon
that is seen only from one side. If the polygon is turned so that the other
side faces the camera, then it's not rendered.
  Povray only uses 2-sided polygons (ie. they are rendered now matter how they
are rotated). I don't know of any plans of adding support for 1-sided polygons
to povray (I'm not even sure how easy it is to make in raytracing).

  (I think that many people here will answer you with the double_illuminate
thing, but I suppose that that was not what you are asking, but I think it's
that visibility thing. Correct me if I'm wrong.)

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

From: Jason Miller
Subject: Re: Normals in Pov
Date: 17 Jul 2000 13:17:32
Message: <39733fac$1@news.povray.org>
Warp,
    It is the visibility thing that I am concerned about.  And as far as
implimenting a raytracer, its very easy to make it one sided or two.
Anyways, the reason I ask is becuase a sphere that I used my program to
convert from another format to pov, only shows half of the polygons.  I know
for a fact that the other program that writes this format does not care
about winding.
Jason


"Warp" <war### [at] tagpovrayorg> wrote in message
news:39730dfc@news.povray.org...
> Jason Miller <jas### [at] pinheirotcimetnet> wrote:
> : Does Povray care about the winding of a mesh?  As in, does it use 1
sided or
> : 2 sided polygons?  If it uses one sided, how can this be set to 2 sided?
>
>   I suppose that a 1-sided polygon is (like, for example, in OpenGL) a
polygon
> that is seen only from one side. If the polygon is turned so that the
other
> side faces the camera, then it's not rendered.
>   Povray only uses 2-sided polygons (ie. they are rendered now matter how
they
> are rotated). I don't know of any plans of adding support for 1-sided
polygons
> to povray (I'm not even sure how easy it is to make in raytracing).
>
>   (I think that many people here will answer you with the
double_illuminate
> thing, but I suppose that that was not what you are asking, but I think
it's
> that visibility thing. Correct me if I'm wrong.)
>
> --
> 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

From: John VanSickle
Subject: Re: Normals in Pov
Date: 17 Jul 2000 18:11:54
Message: <397384C5.BBFD2ECC@erols.com>
Jason Miller wrote:
> 
> Does Povray care about the winding of a mesh?  As in, does it use 1
> sided or 2 sided polygons?  If it uses one sided, how can this be set
> to 2 sided?

Triangles are two-sided, and the sides will be rendered differently if
there is a normal pattern applied.

For flat triangles the normal is derived from a cross-product of two
of the edge vectors (I presume) and therefore depends on the order the
vertices are defined.

For flat vectors the normal is derived by interpolation of the specified
vertex normals, and the order is unimportant.

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

From: Warp
Subject: Re: Normals in Pov
Date: 18 Jul 2000 05:39:07
Message: <397425bb@news.povray.org>
Jason Miller <jas### [at] pinheirotcimetnet> wrote:
: Warp,
:     It is the visibility thing that I am concerned about.  And as far as
: implimenting a raytracer, its very easy to make it one sided or two.
: Anyways, the reason I ask is becuase a sphere that I used my program to
: convert from another format to pov, only shows half of the polygons.  I know
: for a fact that the other program that writes this format does not care
: about winding.

  I can only think of two explanations here:

  1. Your program is not exporting all the triangles for some reason, or is
exporting them badly.
  2. Half of the triangles are shadowed in your scene and thus they are
(almost) black, as I suppose is your background? Try putting more light sources
to different sides of the scene to see if it helps.

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

From: Warp
Subject: Re: Normals in Pov
Date: 18 Jul 2000 05:41:32
Message: <3974264c@news.povray.org>
John VanSickle <van### [at] erolscom> wrote:
: For flat triangles the normal is derived from a cross-product of two
: of the edge vectors (I presume) and therefore depends on the order the
: vertices are defined.

  I think it doesn't matter which side the normal is pointing to (as in any
other surface in povray). This specially doesn't matter with triangles since
they do not have interior.

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

From: John VanSickle
Subject: Re: Normals in Pov
Date: 18 Jul 2000 08:08:20
Message: <397448AD.E69AF8D7@erols.com>
Warp wrote:
> 
> John VanSickle <van### [at] erolscom> wrote:
> : For flat triangles the normal is derived from a cross-product of two
> : of the edge vectors (I presume) and therefore depends on the order
> : the vertices are defined.
> 
>   I think it doesn't matter which side the normal is pointing to (as
> in any other surface in povray). This specially doesn't matter with
> triangles since they do not have interior.

I tested this and it seems you're right; my memory is playing tricks on
me again.

Regards,
John


Post a reply to this message

From: Chris Huff
Subject: Re: Normals in Pov
Date: 18 Jul 2000 11:12:45
Message: <chrishuff-6D2AB9.10131618072000@news.povray.org>
In article <3974264c@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

> John VanSickle <van### [at] erolscom> wrote:
> : For flat triangles the normal is derived from a cross-product of two
> : of the edge vectors (I presume) and therefore depends on the order the
> : vertices are defined.
> 
>   I think it doesn't matter which side the normal is pointing to (as in 
> any other surface in povray). This specially doesn't matter with 
> triangles since they do not have interior.

John VanSickle is right, the normal is derived using the cross-product 
of the edge vectors.(or something like that) The "up" side of the 
triangle is determined by the order of the vertices.
For lighting calculations, the normal is always flipped so it points to 
the side the intersecting ray came from, so you don't notice a 
difference. However, the real normal does matter if you are using 
MegaPOV and interior_texture. I am not aware of any other places where 
it matters...

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Mike Williams
Subject: Re: Normals in Pov
Date: 18 Jul 2000 13:22:22
Message: <JtjZGBA4F$c5Ewux@econym.demon.co.uk>
Wasn't it Warp who wrote:
>Jason Miller <jas### [at] pinheirotcimetnet> wrote:
>: Does Povray care about the winding of a mesh?  As in, does it use 1 sided or
>: 2 sided polygons?  If it uses one sided, how can this be set to 2 sided?
>
>  I suppose that a 1-sided polygon is (like, for example, in OpenGL) a polygon
>that is seen only from one side. If the polygon is turned so that the other
>side faces the camera, then it's not rendered.
>  Povray only uses 2-sided polygons (ie. they are rendered now matter how they
>are rotated). I don't know of any plans of adding support for 1-sided polygons
>to povray (I'm not even sure how easy it is to make in raytracing).

I believe that 1-sided polygons are not possible in the current official
version of POVRay, but they can be achieved in MEGAPov by usng the
"interior_texture" keyword.

Every surface is considered to have an interior and an exterior (but
it's not always obvious which is which) and the interior_texture keyword
allows you to have a different texture on the two sides. If you make one
of these textures completely invisible {pigment {rgbt <1,1,1,1>}} then
you've got a 1-sided surface.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: John VanSickle
Subject: Re: Normals in Pov
Date: 18 Jul 2000 18:58:35
Message: <3974E13A.49899E8C@erols.com>
Chris Huff wrote:
> 
> In article <3974264c@news.povray.org>, Warp <war### [at] tagpovrayorg>
> wrote:
> 
> > John VanSickle <van### [at] erolscom> wrote:
> > : For flat triangles the normal is derived from a cross-product of
> > : two of the edge vectors (I presume) and therefore depends on the
> > : order the vertices are defined.
> >
> >   I think it doesn't matter which side the normal is pointing to (as
> > in any other surface in povray). This specially doesn't matter with
> > triangles since they do not have interior.
> 
> John VanSickle is right, the normal is derived using the cross-product
> of the edge vectors.(or something like that) The "up" side of the
> triangle is determined by the order of the vertices.
> For lighting calculations, the normal is always flipped so it points
> to the side the intersecting ray came from, so you don't notice a
> difference.

This is what I tested; the normal does indeed need to be flipped to
achieve this effect.  I'm fairly sure this was done in a recent
version of POV-Ray; I distinctly remember having to reverse the order
of some defined points in order to get the normals pointed the right
way.

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

Goto Latest 10 Messages Next 6 Messages >>>

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