POV-Ray : Newsgroups : povray.newusers : intersection makes grainy picture Server Time
31 Jul 2024 04:20:40 EDT (-0400)
  intersection makes grainy picture (Message 1 to 5 of 5)  
From: Erwin Kalvelagen
Subject: intersection makes grainy picture
Date: 26 Nov 2002 12:39:57
Message: <3de3b1ed$1@news.povray.org>
I am trying to create a body defined by:

  z <= x
  z <= y
  z >= x+y-1
  x,y,z in [0,1]

It seems to work, but the result is a very "grainy" picture.
A single mesh looks fine, but the intersection does not
seem to render as cleanly.


#include "colors.inc"    // The include files contain
#include "stones.inc"    // pre-defined scene elements

#include "textures.inc"    // pre-defined scene elements
#include "shapes.inc"
#include "glass.inc"
#include "metals.inc"
#include "woods.inc"

  camera {
    location <4, 2, -4>
    look_at 0
    angle 30
  }
  background { color White }
  light_source { <3, 3, -3> White }


intersection {

  mesh {
     triangle { <0,0,0> <1,1,0> <0,0,1> }
     triangle { <1,1,0> <0,0,1> <1,1,1> }
     triangle { <0,0,0> <1,0,0> <1,1,0> }
     triangle { <0,0,1> <1,0,1> <1,1,1> }
     triangle { <0,0,0> <1,0,0> <0,0,1> }
     triangle { <1,0,0> <0,0,1> <1,0,1> }
     triangle { <1,0,0> <1,1,0> <1,0,1> }
     triangle { <1,0,1> <1,1,0> <1,1,1> }
     inside_vector  <0.5, 0.25, 0.5>
  }


  mesh {
     triangle { <0,0,0> <0,0,1> <0,1,1> }
     triangle { <1,0,0> <1,0,1> <1,1,1> }
     triangle { <0,0,0> <0,1,1> <1,1,1> }
     triangle { <0,0,0> <1,0,0> <1,1,1> }
     triangle { <0,0,0> <0,0,1> <1,0,0> }
     triangle { <0,0,1> <1,0,0> <1,0,1> }
     triangle { <0,0,1> <0,1,1> <1,1,1> }
     triangle { <0,0,1> <1,0,1> <1,1,1> }
     inside_vector  <0.5, 0.25, 0.5>
  }


  mesh {
     triangle { <1,0,0> <0,0,1> <1,1,1> }
     triangle { <0,0,0> <0,0,1> <1,0,0> }
     triangle { <1,0,0> <1,1,1> <1,1,0> }
     triangle { <0,0,1> <0,1,1> <1,1,1> }
     triangle { <0,0,0> <0,1,0> <1,0,0> }
     triangle { <1,1,0> <0,1,0> <1,0,0> }
     triangle { <0,0,0> <0,1,0> <0,1,1> }
     triangle { <0,0,0> <0,0,1> <0,1,1> }
     inside_vector  <0.5, 0.5, 0.5>
  }

  pigment { Col_Glass_General }

}


--
-----------------------------------------------------------------------------
Erwin Kalvelagen
GAMS Development Corp., http://www.gams.com
erw### [at] gamscom, http://www.gams.com/~erwin
-----------------------------------------------------------------------------


Post a reply to this message

From: Kaveh
Subject: Re: intersection makes grainy picture
Date: 26 Nov 2002 13:25:35
Message: <1fma51j.16ig0pv1ux316oN%kaveh@delete_this.focalimage.com>
Erwin Kalvelagen <erw### [at] verizonnet> wrote:

> It seems to work, but the result is a very "grainy" picture.
> A single mesh looks fine, but the intersection does not
> seem to render as cleanly.

Sounds like coincident surfaces. See section 3.3.6.1 of the manual. I
tried a quick fix, but didn't seem to work. The general remedy is to
move one or of the objects in the intersection by a very small amount so
you don't have two surfaces exactly coincident.

-- 
Kaveh


Post a reply to this message

From: Christoph Hormann
Subject: Re: intersection makes grainy picture
Date: 26 Nov 2002 13:36:54
Message: <3DE3BF44.19C72988@gmx.de>
Erwin Kalvelagen wrote:
> 
> [...]
> 
> It seems to work, but the result is a very "grainy" picture.
> A single mesh looks fine, but the intersection does not
> seem to render as cleanly.

That's because one of your inside vectors is badly chosen, try using:

inside_vector  <0.5, 0.51, 0.5>

for the last mesh.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 15 Nov. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Christopher James Huff
Subject: Re: intersection makes grainy picture
Date: 26 Nov 2002 15:04:17
Message: <chrishuff-F8E273.15012426112002@netplex.aussie.org>
In article <3DE3BF44.19C72988@gmx.de>,
 Christoph Hormann <chr### [at] gmxde> wrote:

> That's because one of your inside vectors is badly chosen, try using:
> 
> inside_vector  <0.5, 0.51, 0.5>
> 
> for the last mesh.

To be more specific, the mesh insideness algorithm counts the 
intersections with a ray from the point being tested in the direction 
given to inside_vector. If there are an odd number of intersections, the 
point is considered inside the mesh. If that direction is parallel to a 
surface, precision errors will give false intersections and the count 
will be off, making it impossible to decide if the point is inside or 
not. It is the same type of problem as coincident surfaces, you can also 
see it if in some conditions if you have a light source that shines just 
parallel to a surface.
A good inside_vector will not be parallel to any triangle in the mesh.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Erwin Kalvelagen
Subject: Re: intersection makes grainy picture
Date: 27 Nov 2002 14:58:27
Message: <3de523e3@news.povray.org>
Thanks a lot for the help!
--
-----------------------------------------------------------------------------
Erwin Kalvelagen
GAMS Development Corp., http://www.gams.com
erw### [at] gamscom, http://www.gams.com/~erwin
-----------------------------------------------------------------------------


"Christopher James Huff" <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...
> In article <3DE3BF44.19C72988@gmx.de>,
>  Christoph Hormann <chr### [at] gmxde> wrote:
>
> > That's because one of your inside vectors is badly chosen, try using:
> >
> > inside_vector  <0.5, 0.51, 0.5>
> >
> > for the last mesh.
>
> To be more specific, the mesh insideness algorithm counts the
> intersections with a ray from the point being tested in the direction
> given to inside_vector. If there are an odd number of intersections, the
> point is considered inside the mesh. If that direction is parallel to a
> surface, precision errors will give false intersections and the count
> will be off, making it impossible to decide if the point is inside or
> not. It is the same type of problem as coincident surfaces, you can also
> see it if in some conditions if you have a light source that shines just
> parallel to a surface.
> A good inside_vector will not be parallel to any triangle in the mesh.
>
> --
> Christopher James Huff <cja### [at] earthlinknet>
> http://home.earthlink.net/~cjameshuff/
> POV-Ray TAG: chr### [at] tagpovrayorg
> http://tag.povray.org/


Post a reply to this message

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