POV-Ray : Newsgroups : povray.binaries.images : POVEarth: Tristan da Cunha: gaps between mesh2 triangles Server Time
1 Nov 2024 10:16:53 EDT (-0400)
  POVEarth: Tristan da Cunha: gaps between mesh2 triangles (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Jörg 'Yadgar' Bleimann
Subject: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 30 Jun 2013 15:00:40
Message: <51d08058@news.povray.org>
Hi(gh)!

Meanwhile, I managed to produce some first crude ground based views of 
Tristan da Cunha (from Inaccessible Island towards the main island) at 
"pedestrian height". i. e. 1.7 metres above the ground. The ocean 
currently is a simple dark blue global sphere (to be replaced by some 
semi-transparent basic water texture later on), the sky a simple 
sky_sphere with a gradient aligning with the local normal vector (to 
replaced either by Bruno Cabasson's or Christoph Hormann's atmosphere 
model), also the terrain texture soon will be replaced by a Blue Marble 
satellite mosaic texture (scaled from originally 240 x 240 to 3601 x 
3601 pixels, as this is the original data resolution of the underlying 
ASTER DEMs.

But now a problem shows up which I faced already some years before: gaps 
between the single mesh2 triangles! I remember having dealt with this as 
early as 2004 and, with help from Mike Williams, also satisfactorily 
solved: just by translating the center of the Earth (and thus the mesh2) 
by an amount which places the mesh2 vectors at coordinates of relatively 
small orders of magnitude (i. e. not millions but rather thousands or 
even only hundreds of POV units). Back then it worked fine (as you can 
see with my "Flight over Afghan mountains" animation: 
https://www.youtube.com/watch?v=abgq4Zo_nOw ) - but now it doesn't anymore!

Regardless which overall scaling factor I use (in the attached image 
sequence from 1 down to 0.0001), the gaps never completely disappear... 
instead, at very small values, increasingly portions of the mesh are 
shadowed which should be illuminated.

Can be anything done about this - or is this an inaccuracy of POV-Ray 
which is entirely unavoidable?

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 2.jpg' (38 KB) Download '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 3 (scaling factor 0.1).jpg' (46 KB) Download '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 4 (scaling factor 0.01).jpg' (44 KB) Download '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 5 (scaling factor 0.001).jpg' (40 KB) Download '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 9 (scaling factor 0.0009).jpg' (47 KB) Download '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 8 (scaling factor 0.0008).jpg' (46 KB) Download '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 7 (scaling factor 0.0005).jpg' (32 KB) Download '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 6 (scaling factor 0.0001).jpg' (24 KB)

Preview of image '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 2.jpg'
2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 2.jpg

Preview of image '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 3 (scaling factor 0.1).jpg'
2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 3 (scaling factor 0.1).jpg

Preview of image '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 4 (scaling factor 0.01).jpg'
2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 4 (scaling factor 0.01).jpg

Preview of image '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 5 (scaling factor 0.001).jpg'
2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 5 (scaling factor 0.001).jpg

Preview of image '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 9 (scaling factor 0.0009).jpg'
2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 9 (scaling factor 0.0009).jpg

Preview of image '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 8 (scaling factor 0.0008).jpg'
2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 8 (scaling factor 0.0008).jpg

Preview of image '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 7 (scaling factor 0.0005).jpg'
2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 7 (scaling factor 0.0005).jpg

Preview of image '2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 6 (scaling factor 0.0001).jpg'
2013-06-30 tristan da cunha from inaccessible island, pedestrian view, take 6 (scaling factor 0.0001).jpg


 

From: Stephen
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 30 Jun 2013 15:28:37
Message: <51d086e5$1@news.povray.org>

> Can be anything done about this

Just a short in the dark, Jorg.
Blender has the functionality to fill a hole in a mesh with faces.

http://wiki.blender.org/index.php/Doc:2.4/Tutorials/Modeling/Meshes/Fill_Faces

It might help and it is free. ;-)

-- 
Regards
     Stephen


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 30 Jun 2013 16:09:10
Message: <51d09066@news.povray.org>
Hi(gh)!

On 30.06.2013 21:28, Stephen wrote:

> Just a short in the dark, Jorg.
> Blender has the functionality to fill a hole in a mesh with faces.
>
> http://wiki.blender.org/index.php/Doc:2.4/Tutorials/Modeling/Meshes/Fill_Faces
>
>
> It might help and it is free. ;-)

Yes, I heard of Blender (and sometimes even used it) - but this is 
probably not the solution, as "technically", the mesh is complete, i. e. 
no triangles are missing. It must be an accuracy or epsilon problem...

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Stephen
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 30 Jun 2013 16:25:10
Message: <51d09426@news.povray.org>

> Hi(gh)!
>
> On 30.06.2013 21:28, Stephen wrote:
>
>> Just a short in the dark, Jorg.
>> Blender has the functionality to fill a hole in a mesh with faces.
>>
>> http://wiki.blender.org/index.php/Doc:2.4/Tutorials/Modeling/Meshes/Fill_Faces
>>
>>
>>
>> It might help and it is free. ;-)
>
> Yes, I heard of Blender (and sometimes even used it) - but this is
> probably not the solution, as "technically", the mesh is complete, i. e.
> no triangles are missing. It must be an accuracy or epsilon problem...
>
> See you in Khyberspace!
>
> Yadgar
>

As I said. It was a shot in the dark.

-- 
Regards
     Stephen


Post a reply to this message

From: Thomas de Groot
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 03:03:12
Message: <51d129b0@news.povray.org>
It seems to me that the triangle are floating, the vertices not being 
joint properly together. If that is true, the solution is simple: load 
the mesh2 into Poseray, go to Groups, push the button labelled Weld 
vertices, save as mesh2 again.

Additionally, beware indeed of epsilon issues. Put the camera a little 
bit higher from the ground.

Thomas


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 04:56:21
Message: <51d14435$1@news.povray.org>
Hi(gh)!

On 01.07.2013 09:03, Thomas de Groot wrote:
> It seems to me that the triangle are floating, the vertices not being
> joint properly together.

I think they should, as this is the code for the mesh2:

#declare Earth_Slice=
mesh2
{
   vertex_vectors
   {
     xdim*ydim
     #declare row=0;
     #while (row<ydim)
       #declare col=0;
       #while (col<xdim)
         #declare clrvect=eval_pigment(map, <1/(xdim*2)+col/xdim, 
1-(1/(ydim*2)+row/ydim), 1>);
         // #warning concat("<",vstr(3, clrvect, ",",7,2),">")
         // #warning concat(str(col,2,0)," ",str(row,2,0))
         #declare hval=clrvect.red*65280+clrvect.green*255;
         #declare hval=-deadsea+rng/65535*hval;
         // #warning str(hval, 1, 2)
 
(rd+hval)*<sin(radians(-longstart-col/xdim))*cos(radians(latstart-row/ydim)),
                  sin(radians(latstart-row/ydim)), 
cos(radians(-longstart-col/xdim))*cos(radians(latstart-row/ydim))>*sf
         #if (!(row=ydim-1 & col=xdim-1)) // no comma after last vector
           ,
         #end
         #declare col=col+1;
       #end
       #declare row=row+1;
     #end
   }
   face_indices
   {
     (xdim-1)*(ydim-1)*2
     #declare r=0;
     #while (r<ydim-1)
       #declare c=0;
       #while (c<xdim-1)
         <r*xdim+c, r*xdim+c+1, (r+1)*xdim+c>,
         <r*xdim+c+1, (r+1)*xdim+c+1, (r+1)*xdim+c>
         #if (!(r=ydim-2 & c=xdim-2)) // no comma after last vector
           ,
         #end
         #declare c=c+1;
       #end
       #declare r=r+1;
     #end
   }
   texture
   {
     pigment { color rgb <0, 0.8, 0> }
     finish { ambient 0.1 diffuse 1 brilliance 0.4 }
   }
   double_illuminate
   translate ApproxLook*sf
}



> If that is true, the solution is simple: load
> the mesh2 into Poseray, go to Groups, push the button labelled Weld
> vertices, save as mesh2 again.

Poseray? Is it free?

> Additionally, beware indeed of epsilon issues. Put the camera a little
> bit higher from the ground.

In my current scene, the camera is placed at "pedestrian eye's height", 
i. e. 1.7 metres above ground. But the problem remains with any camera 
height - the gaps then show up as black dots on the terrain!

See you in Khyberspace!

Yadgar

Now playing: Master of Sensation (Eloy)


Post a reply to this message

From: Stephen
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 05:57:56
Message: <51d152a4$1@news.povray.org>

> Poseray? Is it free?

Yes, it is an excellent program

https://sites.google.com/site/poseray/

-- 
Regards
     Stephen


Post a reply to this message

From: Thomas de Groot
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 07:19:33
Message: <51d165c5$1@news.povray.org>

> I think they should, as this is the code for the mesh2:
>
> #declare Earth_Slice=
> mesh2
> {
>    vertex_vectors
>    {
>      xdim*ydim
>      #declare row=0;
>      #while (row<ydim)
>        #declare col=0;
>        #while (col<xdim)
>          #declare clrvect=eval_pigment(map, <1/(xdim*2)+col/xdim,
> 1-(1/(ydim*2)+row/ydim), 1>);

I cannot read that ;-)

Thinking a bit more about this, meshes with loose triangles at least 
have their vertices at the /same/ locations; here there seems to be a 
gap. Either, this is already present in the original DEMs, or the math 
above for the conversion has some errors... Difficult to say.

Poseray is free indeed and it is worth a try. If it does not solve the 
issue, then other solutions have to be found. In Poseray, the tolerance 
for welding vertices can be adapted. Start with the default; if 
necessary increase the value gradually.

Thomas


Post a reply to this message

From: scott
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 08:05:27
Message: <51d17087@news.povray.org>
> #declare Earth_Slice=
> mesh2
> {
>    vertex_vectors
>    {
>      xdim*ydim
>      #declare row=0;
>      #while (row<ydim)
>        #declare col=0;
>        #while (col<xdim)
>          #declare clrvect=eval_pigment(map, <1/(xdim*2)+col/xdim,
> 1-(1/(ydim*2)+row/ydim), 1>);
>          // #warning concat("<",vstr(3, clrvect, ",",7,2),">")
>          // #warning concat(str(col,2,0)," ",str(row,2,0))
>          #declare hval=clrvect.red*65280+clrvect.green*255;
>          #declare hval=-deadsea+rng/65535*hval;
>          // #warning str(hval, 1, 2)
>
> (rd+hval)*<sin(radians(-longstart-col/xdim))*cos(radians(latstart-row/ydim)),
>
>                   sin(radians(latstart-row/ydim)),
> cos(radians(-longstart-col/xdim))*cos(radians(latstart-row/ydim))>*sf

I would put something very simple like this for debug purposes:

<row,col,hval>

...

>    face_indices
>    {
>      (xdim-1)*(ydim-1)*2
>      #declare r=0;
>      #while (r<ydim-1)
>        #declare c=0;
>        #while (c<xdim-1)
>          <r*xdim+c, r*xdim+c+1, (r+1)*xdim+c>,
>          <r*xdim+c+1, (r+1)*xdim+c+1, (r+1)*xdim+c>

That looks fine to me.

Put your camera in a suitable location for the above debug mesh to show 
up, and put a constant coloured background so that you can see the 
difference between shadowed areas and areas not rendered properly.

Assuming the above test works then I would gradually build back up to 
your equations (maybe first changing the scale to match, then 
introducing the trig) to see what causes the problems.

My guess is accuracy because you are dealing with a huge dynamic range 
of dimensions.


Post a reply to this message

From: scott
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 08:20:39
Message: <51d17417$1@news.povray.org>
>>    vertex_vectors
>>    {
>>      xdim*ydim
>>      #declare row=0;
>>      #while (row<ydim)
>>        #declare col=0;
>>        #while (col<xdim)
>>          #declare clrvect=eval_pigment(map, <1/(xdim*2)+col/xdim,
>> 1-(1/(ydim*2)+row/ydim), 1>);
>
> I cannot read that ;-)
>
> Thinking a bit more about this, meshes with loose triangles at least
> have their vertices at the /same/ locations; here there seems to be a
> gap. Either, this is already present in the original DEMs, or the math
> above for the conversion has some errors... Difficult to say.

Even if it has errors it shouldn't introduce gaps as he is using 
face_indices to reference the vertices (all 6 triangles using that 
vertex will have exactly the same value, even if it is an incorrect value).


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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