POV-Ray : Newsgroups : povray.binaries.images : POVEarth: Distorted Terrain Texture : POVEarth: Distorted Terrain Texture Server Time
28 Apr 2024 15:32:04 EDT (-0400)
  POVEarth: Distorted Terrain Texture  
From: Jörg "Yadgar" Bleimann
Date: 13 Aug 2020 11:42:53
Message: <5f355f7d$1@news.povray.org>
Hi(gh)!

Meanwhile, I fixed mesh2writer.pov and placed the global flattening of 
the mesh2 object into povearth.pov... but now another problem showed up: 
the terrain texture is strangely distorted, as if in each line of 
vertices, one texture sample is omitted (see attachment).

The respective code in mesh2writer.pov:

// begin code

#if (!(tilename="n80e014" | tilename="n80e016" | tilename="n80e017")) // 
for elevation data tiles north of 80°N, no Blue Marble texture tiles are 
available!
   #declare i=0;
   #write (ES, "  texture_list")
   #write (ES, "  {\n")
   #write (ES, concat("    ",str(NumTextures, 1, 0),"\n"))
   #for (a, 0, ydim-1)

     #for (b, 0, xdim-1)
       #declare C_Texture = eval_pigment(P_Texture, 
<(0.5+b)*(1/(xdim-1)), (0.5+a)*(1/(ydim-1)), 0>);
       // #warning concat("Iteration ", str(a, 1, 0), "-", str(b, 1, 0))
       #write (ES, "    texture\n")
       #write (ES, "    {\n")
       #write (ES, "      pigment\n")
       #write (ES, "      {\n")
       #write (ES, concat("	   color rgb <",vstr(3, C_Texture, ",", 1, 
7),">\n"))
       #write (ES, "      }\n")
       #write (ES, "    }\n")
       // #declare c=c+1;
     #end
   #end
   #write (ES, "  }\n")
#end

// end code

I tried to replace xdim-1 and ydim-1 with xdim and ydim respectively, 
but then got the error message "missing }, texture found instead" - 
obviously, NumTextures is exceeded. But when I in fact use the full xdim 
and ydim values, shouldn't there be a black last column and row?

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download 'tbilisi.png' (320 KB)

Preview of image 'tbilisi.png'
tbilisi.png


 

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