POV-Ray : Newsgroups : povray.general : Does disc normal vector interfere with scattering media? Server Time
6 Nov 2024 20:21:01 EST (-0500)
  Does disc normal vector interfere with scattering media? (Message 1 to 10 of 10)  
From: Scott Gammans
Subject: Does disc normal vector interfere with scattering media?
Date: 22 Mar 2004 21:10:20
Message: <405f9c8c$1@news.povray.org>
I created a model of Saturn using a disc for the rings, but I kept running
into a strange problem that I'm wondering if it's a bug.

To depict the gas giant's atmosphere, I added type 4 scattering media to the
planet sphere to give a little pale yellow glow at the edge of the sphere.
But when I placed the camera either above or below the rings **inside** the
outer radius of the rings, the scattering media on the sphere disappeared on
the side of the disc that was the **opposite** of the disc's normal vector.

For instance, if I declared the rings disc like this:

#declare Saturn_Rings =  disc {0, y, 4500, 2250 texture {...}}

and I placed the camera at <0,-100,2500>, the atmospheric scattering on the
edge of the Saturn sphere would disappear below the plane of the disc. If I
reversed the vector like so:

#declare Saturn_Rings =  disc {0, -y, 4500, 2250 texture {...}}

and re-ran the render, the scattering edge would reappear below the plane of
the disc, but it would disappear **above** the disc plane.

I know I'm not declaring the media on the planet incorrectly, because the
problem went away when I substituted a very, very thin cylinder for the disc
to depict the rings (the media on the sphere was visible no matter where I
placed the camera).

So, is this a known problem with the disc object and I missed it in the
documentation and the bug reports forum, or what? Thanks...


Post a reply to this message

From: Alain
Subject: Re: Does disc normal vector interfere with scattering media?
Date: 22 Mar 2004 21:19:06
Message: <405f9e9a$1@news.povray.org>
Scott Gammans nous apporta ses lumieres ainsi en ce 2004/03/22 21:10... :

>I created a model of Saturn using a disc for the rings, but I kept running
>into a strange problem that I'm wondering if it's a bug.
>
>To depict the gas giant's atmosphere, I added type 4 scattering media to the
>planet sphere to give a little pale yellow glow at the edge of the sphere.
>But when I placed the camera either above or below the rings **inside** the
>outer radius of the rings, the scattering media on the sphere disappeared on
>the side of the disc that was the **opposite** of the disc's normal vector.
>
>For instance, if I declared the rings disc like this:
>
>#declare Saturn_Rings =  disc {0, y, 4500, 2250 texture {...}}
>
>and I placed the camera at <0,-100,2500>, the atmospheric scattering on the
>edge of the Saturn sphere would disappear below the plane of the disc. If I
>reversed the vector like so:
>
>#declare Saturn_Rings =  disc {0, -y, 4500, 2250 texture {...}}
>
>and re-ran the render, the scattering edge would reappear below the plane of
>the disc, but it would disappear **above** the disc plane.
>
>I know I'm not declaring the media on the planet incorrectly, because the
>problem went away when I substituted a very, very thin cylinder for the disc
>to depict the rings (the media on the sphere was visible no matter where I
>placed the camera).
>
>So, is this a known problem with the disc object and I missed it in the
>documentation and the bug reports forum, or what? Thanks...
>
>
>  
>
Did you try to make your disk hollow?
It looks like the disk is a piece cut out of a plane.
#declare Saturn_Rings = disc {0, -y, 4500, 2250 texture {...}hollow}

Alain


Post a reply to this message

From: Scott Gammans
Subject: Re: Does disc normal vector interfere with scattering media?
Date: 22 Mar 2004 21:28:00
Message: <405fa0b0$1@news.povray.org>
Alain,

First of all, you definitely should win tonight's prize for fastest response
(8 minutes!).

It never would have occurred to me to add the "hollow" keyword; I thought a
disc was supposed to be infinitely thin and that "hollow" wouldn't apply.

But sure enough, once I added "hollow" to the disc definition, the problem
disappeared. Thanks!


"Alain" <aze### [at] qwertygov> wrote in message
news:405f9e9a$1@news.povray.org...
> Scott Gammans nous apporta ses lumieres ainsi en ce 2004/03/22 21:10... :
>
> >I created a model of Saturn using a disc for the rings, but I kept
running
> >into a strange problem that I'm wondering if it's a bug.
> >
> >To depict the gas giant's atmosphere, I added type 4 scattering media to
the
> >planet sphere to give a little pale yellow glow at the edge of the
sphere.
> >But when I placed the camera either above or below the rings **inside**
the
> >outer radius of the rings, the scattering media on the sphere disappeared
on
> >the side of the disc that was the **opposite** of the disc's normal
vector.
> >
> >For instance, if I declared the rings disc like this:
> >
> >#declare Saturn_Rings =  disc {0, y, 4500, 2250 texture {...}}
> >
> >and I placed the camera at <0,-100,2500>, the atmospheric scattering on
the
> >edge of the Saturn sphere would disappear below the plane of the disc. If
I
> >reversed the vector like so:
> >
> >#declare Saturn_Rings =  disc {0, -y, 4500, 2250 texture {...}}
> >
> >and re-ran the render, the scattering edge would reappear below the plane
of
> >the disc, but it would disappear **above** the disc plane.
> >
> >I know I'm not declaring the media on the planet incorrectly, because the
> >problem went away when I substituted a very, very thin cylinder for the
disc
> >to depict the rings (the media on the sphere was visible no matter where
I
> >placed the camera).
> >
> >So, is this a known problem with the disc object and I missed it in the
> >documentation and the bug reports forum, or what? Thanks...
> >
> >
> >
> >
> Did you try to make your disk hollow?
> It looks like the disk is a piece cut out of a plane.
> #declare Saturn_Rings = disc {0, -y, 4500, 2250 texture {...}hollow}
>
> Alain
>
>


Post a reply to this message

From: Chris Johnson
Subject: Re: Does disc normal vector interfere with scattering media?
Date: 22 Mar 2004 21:53:11
Message: <405fa697$1@news.povray.org>
I think the 'plane' object is treated like an infinitely large box: i.e. one
side of the plane is inside, and the other is outside. Since as Alain says,
the disc object is based on the plane object, it looks as though this has
inherited the 'inside' behaviour too, though its less clear where the
'inside' of a finite subset of the plane should be.

-Chris


Post a reply to this message

From: Tom Melly
Subject: Re: Does disc normal vector interfere with scattering media?
Date: 23 Mar 2004 04:39:36
Message: <406005d8@news.povray.org>
"Scott Gammans" <dee### [at] yahoocom> wrote in message
news:405f9c8c$1@news.povray.org...
> I created a model of Saturn using a disc for the rings, but I kept running
> into a strange problem that I'm wondering if it's a bug.
>

Well, you've got your answer, but rest assured that this is a common gotcha
(i.e. completely unintuitive). It probably ought to be emphasised in the docs,
but, to be frank, we'd all still run into it one day or another....


Post a reply to this message

From: Warp
Subject: Re: Does disc normal vector interfere with scattering media?
Date: 23 Mar 2004 05:55:22
Message: <4060179a@news.povray.org>
Scott Gammans <dee### [at] yahoocom> wrote:
> It never would have occurred to me to add the "hollow" keyword; I thought a
> disc was supposed to be infinitely thin and that "hollow" wouldn't apply.

  All objects in POV-Ray are "infinitely thin", yet most of them have an
inside, even those which are not closed surfaces.
  Right now I can only think of triangles, meshes and bicubic patches not
having a defined inside.

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

From: andrel
Subject: Re: Does disc normal vector interfere with scattering media?
Date: 24 Mar 2004 10:56:33
Message: <4061AF89.2020004@hotmail.com>
Warp wrote:

> Scott Gammans <dee### [at] yahoocom> wrote:
> 
>>It never would have occurred to me to add the "hollow" keyword; I thought a
>>disc was supposed to be infinitely thin and that "hollow" wouldn't apply.
> 
> 
>   All objects in POV-Ray are "infinitely thin", yet most of them have an
> inside, even those which are not closed surfaces.
>   Right now I can only think of triangles, meshes and bicubic patches not
> having a defined inside.
They do have an orientation, depending on the order in
which the vertices are listed. If we number the vertices
of a triangle clockwise a,b, and c then (b-a)x(c-a)
always points outwards (with the 'x' denoting
the cross product. This crossproduct points in the
direction of the normal on the surface and the length is
the size of the triangle).In a closed triangular mesh all normals
should point outwards. That is also the reason why the
other side of the triangle (or mesh or patch) can be textured
differently by using the 'interior_texture' keyword.
If you think of closed surfaces this makes sense but it
looks a bit strange for essentially thin an flat objects
like pieces of paper or butterfly wings.
I must add here of course that in the real 3D world
there are no 2D objects. Perhaps using 'interior_texture'
is a good reminder that you take a shortcut ;).


Post a reply to this message

From: Sebastian H 
Subject: Re: Does disc normal vector interfere with scattering media?
Date: 24 Mar 2004 14:07:10
Message: <4061dc5e$1@news.povray.org>
> They do have an orientation, depending on the order in
> which the vertices are listed. If we number the vertices
> of a triangle clockwise a,b, and c then (b-a)x(c-a)
> always points outwards (with the 'x' denoting
> the cross product. This crossproduct points in the
> direction of the normal on the surface and the length is
> the size of the triangle).
Is this a right-handed or a left-handed crossproduct and
isn't it 2 times the triangle Area?


Post a reply to this message

From: andrel
Subject: Re: Does disc normal vector interfere with scattering media?
Date: 24 Mar 2004 15:08:30
Message: <4061EA99.7010404@hotmail.com>
Sebastian H. wrote:

>> They do have an orientation, depending on the order in
>> which the vertices are listed. If we number the vertices
>> of a triangle clockwise a,b, and c then (b-a)x(c-a)
>> always points outwards (with the 'x' denoting
>> the cross product. This crossproduct points in the
>> direction of the normal on the surface and the length is
>> the size of the triangle).
> 
> Is this a right-handed or a left-handed crossproduct 
Actually I do not know how it is implemented in POV.
I could have checked by creating a small scene, but
I though that for the point that triangles have
a consistent orientation it did not matter enough.
The meshes I create have a consistent orientation
of the normals. If I use interior_texture in 50%
of cases I will do it right and in the other 50%
it is right the second time :)
> and isn't it 2 times the triangle Area?
whoops, you are correct. It is the area of the
parallelogram with sides (b-a) and (c-a) and
the triangle has half that area.


Post a reply to this message

From: Sebastian H 
Subject: Re: Does disc normal vector interfere with scattering media?
Date: 25 Mar 2004 07:05:56
Message: <4062cb24$1@news.povray.org>
andrel wrote:
> 
> 
> Sebastian H. wrote:
> 
>>> They do have an orientation, depending on the order in
>>> which the vertices are listed. If we number the vertices
>>> of a triangle clockwise a,b, and c then (b-a)x(c-a)
>>> always points outwards (with the 'x' denoting
>>> the cross product. This crossproduct points in the
>>> direction of the normal on the surface and the length is
>>> the size of the triangle).
>>
>>
>> Is this a right-handed or a left-handed crossproduct 
> 
> Actually I do not know how it is implemented in POV.
> I could have checked by creating a small scene, but
> I though that for the point that triangles have
> a consistent orientation it did not matter enough.
> The meshes I create have a consistent orientation
> of the normals. If I use interior_texture in 50%
> of cases I will do it right and in the other 50%
> it is right the second time :)

Me don't know, too :-).
The docs don't say anything about this, there is only stated the vcross 
(the inbuild function) creates a vector perpendicular to the source 
vectors.
I just thought that if POV uses a left handed coordinate system it be 
would consequently to use a left handed crossproduct. But maybe this 
would create just more confusion because most people are used to the 
right handed crossproduct. On the other hand most people are more used 
to the right handed coordinate system, I guess. Hmm...
In the end it doesn't matter as long as you know what you are doing ;-).

Regards,
Sebastian H.


Post a reply to this message

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