POV-Ray : Newsgroups : povray.binaries.images : Applying textures to a spherical heightfield section afterwards? Server Time
9 Oct 2026 21:56:47 EDT (-0400)
  Applying textures to a spherical heightfield section afterwards? (Message 1 to 17 of 17)  
From: Jörg "Yadgar" Bleimann
Subject: Applying textures to a spherical heightfield section afterwards?
Date: 11 Sep 2020 20:14:16
Message: <5f5c12d8$1@news.povray.org>
Hi(gh)!

Meanwhile, the process of generating POVEarth heightfields from ASTER 
data tiles runs pretty fine... but: as currently, the texture is a part 
of the generated mesh2 script, whenever I want to change the texture 
itself, I have to generate a new mesh2 script - and they are 3 gigabytes 
large! Is there a chance to apply the surface texture (which is a 240 x 
240 pixel section from NASA's huge "Blue Marble" mosaics for each square 
degree tile) after the creation of the mesh2 without using the whole 
"Blue Marble" mosaic? Or, to be more precise, can I constrain an 
image_map to a certain region of a sphere?

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Le Forgeron
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 12 Sep 2020 05:51:31
Message: <5f5c9a23$1@news.povray.org>
Le 12/09/2020 à 02:14, Jörg "Yadgar" Bleimann a écrit :
> Hi(gh)!
> 
> Meanwhile, the process of generating POVEarth heightfields from ASTER
> data tiles runs pretty fine... but: as currently, the texture is a part
> of the generated mesh2 script, whenever I want to change the texture
> itself, I have to generate a new mesh2 script - and they are 3 gigabytes
> large! Is there a chance to apply the surface texture (which is a 240 x
> 240 pixel section from NASA's huge "Blue Marble" mosaics for each square
> degree tile) after the creation of the mesh2 without using the whole
> "Blue Marble" mosaic? Or, to be more precise, can I constrain an
> image_map to a certain region of a sphere?
> 
> See you in Khyberspace!
> 
> Yadgar

Did you look at uv-mapping ?

script generates the mesh2 with uv-coordinates of the points, and
"later", you provide the texture/pigment as an image.

The range of uv for the script is very small (as the whole earth would
use 0-1 x 0-1 .


Post a reply to this message

From: Jörg "Yadgar" Bleimann
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 12 Sep 2020 07:08:06
Message: <5f5cac16$1@news.povray.org>
Hi(gh)!

On 12.09.20 11:51, Le_Forgeron wrote:

> script generates the mesh2 with uv-coordinates of the points, and
> "later", you provide the texture/pigment as an image.
> 
> The range of uv for the script is very small (as the whole earth would
> use 0-1 x 0-1 .

According to the official 3.7 tutorial, the texture/pigment statement 
still has to be part of the original mesh2 definition - so that would be 
no solution to my problem!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Bald Eagle
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 12 Sep 2020 09:10:09
Message: <web.5f5cc79f57afda211f9dae300@news.povray.org>
=?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:

> According to the official 3.7 tutorial, the texture/pigment statement
> still has to be part of the original mesh2 definition -

The _NAME_ of the texture does - which can be defined in the pov file that then
includes your mesh2.


Post a reply to this message

From: Le Forgeron
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 12 Sep 2020 09:55:04
Message: <5f5cd338$1@news.povray.org>
Le 12/09/2020 à 15:05, Bald Eagle a écrit :
> =?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:
> 
>> According to the official 3.7 tutorial, the texture/pigment statement
>> still has to be part of the original mesh2 definition -
> 
> The _NAME_ of the texture does - which can be defined in the pov file that then
> includes your mesh2.
> 
> 
See, we have smart people here !


Post a reply to this message

From: Bald Eagle
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 12 Sep 2020 16:15:01
Message: <web.5f5d2bd457afda211f9dae300@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> See, we have smart people here !

The only difference between the master and the novice is that the master has
failed more times then the novice has tried. -Stephen McCranie

Oh, how this forum has witnessed my many and repeated failures...


Post a reply to this message

From: Jörg "Yadgar" Bleimann
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 13 Sep 2020 22:36:55
Message: <5f5ed747$1@news.povray.org>
Hi(gh)!

On 12.09.20 15:05, Bald Eagle wrote:
> =?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:
> 
>> According to the official 3.7 tutorial, the texture/pigment statement
>> still has to be part of the original mesh2 definition -
> 
> The _NAME_ of the texture does - which can be defined in the pov file that then
> includes your mesh2.

O.k., I tried this - with the following code in my mesh2 generator 
replacing the texture_list:

// begin code

   #write (ES, concat("  uv_vectors\n",
		     "  {\n",
		     "    ",str(NumUVVectors, 1, 0),"\n"))
   #for (a, 0, ydim-1)
     #for (b, 0, xdim-1)
       #write (ES, concat("<", str(b*(1/xdim), 1, 6), ",", 
str(a*(1/ydim), 1, 6), ">"))
       #if (a < ydim-1 & b < xdim-1)
	#write (ES, ",")
       #end
       #write (ES, "\n")
     #end
   #end
   #write (ES, "  }\n")

// end of code

But, depending on whether I set the #for loop limits and the #if 
condition for the last vector to ydim-1, xdim-1 or ydim-2, xdim-2, I 
either get "Texture index out of range" or "Expected 'numeric
  expression', } found instead". What goes wrong?

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Le Forgeron
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 14 Sep 2020 12:34:24
Message: <5f5f9b90$1@news.povray.org>
Le 14/09/2020 à 04:36, Jörg "Yadgar" Bleimann a écrit :
> Hi(gh)!
> 
> On 12.09.20 15:05, Bald Eagle wrote:
>> =?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:
>>
>>> According to the official 3.7 tutorial, the texture/pigment statement
>>> still has to be part of the original mesh2 definition -
>>
>> The _NAME_ of the texture does - which can be defined in the pov file
>> that then
>> includes your mesh2.
> 
> O.k., I tried this - with the following code in my mesh2 generator
> replacing the texture_list:
> 
> // begin code
> 
>   #write (ES, concat("  uv_vectors\n",
>              "  {\n",
>              "    ",str(NumUVVectors, 1, 0),"\n"))

How is NumUVVectors computed ? it should be xdim*ydim.
or (xdim+1)*(ydim+1) if range of #for are (0, ydim) and (0, xdim)

>   #for (a, 0, ydim-1)
>     #for (b, 0, xdim-1)

Range problem, b/xdim is never reaching 1.0, same for a/ydim.

>       #write (ES, concat("<", str(b*(1/xdim), 1, 6), ",",
> str(a*(1/ydim), 1, 6), ">"))

I hate that code:

>       #if (a < ydim-1 & b < xdim-1)

because it seems, to my eyes, ambiguous about order of operations.

Please put more ().


Post a reply to this message

From: Jörg "Yadgar" Bleimann
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 14 Sep 2020 13:18:16
Message: <5f5fa5d8$1@news.povray.org>
Hi(gh)!

On 14.09.20 18:34, Le_Forgeron wrote:

> How is NumUVVectors computed ? it should be xdim*ydim.
> or (xdim+1)*(ydim+1) if range of #for are (0, ydim) and (0, xdim)
> 
>>    #for (a, 0, ydim-1)
>>      #for (b, 0, xdim-1)
> 
> Range problem, b/xdim is never reaching 1.0, same for a/ydim.
> 
>>        #write (ES, concat("<", str(b*(1/xdim), 1, 6), ",",
>> str(a*(1/ydim), 1, 6), ">"))
> 
> I hate that code:
> 
>>        #if (a < ydim-1 & b < xdim-1)
> 
> because it seems, to my eyes, ambiguous about order of operations.
> 
> Please put more ().
> 

I tried your suggestions, but still get the "out of range" error!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Bald Eagle
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 14 Sep 2020 13:40:00
Message: <web.5f5faa7857afda211f9dae300@news.povray.org>
=?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:

> I tried your suggestions, but still get the "out of range" error!

I can say from long and painful experience that you need more (switchable)
#debug statements so that you can follow along as the code progresses.

While you're putting those in, it would likely be useful to tidy up the
calculations and maybe split long or confusing operations into multiple steps,
with comments.

You're deep into the territory of "check your assumptions" by determining "what
are the facts?".

“What are the facts? Again and again and again – what are the facts? Shun
wishful thinking, ignore divine revelation, forget what “the stars foretell,”
avoid opinion, care not what the neighbors think, never mind the unguessable
“verdict of history” – what are the facts, and to how many decimal places? You
pilot always into an unknown future; facts are your single clue. Get the facts!”

― Robert Heinlein


Post a reply to this message

From: Jörg "Yadgar" Bleimann
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 14 Sep 2020 23:45:09
Message: <5f6038c5@news.povray.org>
On 14.09.20 19:38, Bald Eagle wrote:
> =?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:
> 
>> I tried your suggestions, but still get the "out of range" error!
> 
> I can say from long and painful experience that you need more (switchable)
> #debug statements so that you can follow along as the code progresses.

I included debug.inc, invoked Debug_Inc_Stack()... and nothing happened, 
no additional messages at all, just that notorious "File 
'mesh2/n42e044_5x5.inc' line 96: Parse Error: Texture index out of range 
in mesh2.".

To make things easier, I generated a tiny 5x5 mesh2 before:

#default { finish { ambient 0.05 diffuse 1 brilliance 0.25 } }
#declare ApproxLook = <-3295778.3537,4308723.8277,3353808.4183>;
#declare Earth_Slice_n42e044=
mesh2
{
   vertex_vectors
      {
25
     <2884.8178,-40532.7525,56082.6582>,
     <-9171.5619,-40308.4150,44746.1601>,
     <-21188.6401,-40084.4363,33366.7545>,
     <-32877.9350,-40230.5532,21652.1961>,
     <-44580.6796,-40306.6256,9952.5033>,
     <13057.8787,-23755.4346,45548.1452>,
     <1330.1334,-23909.1988,33947.0299>,
     <-10630.4449,-23708.0951,22585.0805>,
     <-22695.4630,-23321.5223,11326.5482>,
     <-34370.6821,-23387.2495,-329.0233>,
     <23221.9340,-6962.3006,35022.9578>,
     <11316.8721,-6836.8635,23677.4411>,
     <-399.8051,-6905.9531,12137.8952>,
     <-12333.4551,-6640.1561,818.8397>,
     <-24333.2326,-6238.3055,-10436.7932>,
     <33304.7484,9943.2953,24581.8979>,
     <21837.6885,9539.8892,12858.6481>,
     <9658.4610,10127.7787,1866.7320>,
     <-1845.2730,9879.2958,-9816.8170>,
     <-13884.9949,10384.4651,-20958.2292>,
     <43363.8318,26887.7446,14165.4121>,
     <31606.8161,26914.8515,2812.8338>,
     <19694.9660,27199.3287,-8382.2095>,
     <9001.1538,25928.0627,-20815.7556>,
     <-2940.1603,26357.8266,-31979.7411>
     }
	normal_vectors
	{
     25
     <0.5096,-0.6575,-0.5550>,
     <0.5112,-0.6702,-0.5381>,
     <0.4969,-0.6771,-0.5429>,
     <0.5235,-0.6600,-0.5389>,
     <0.5386,-0.6507,-0.5352>,
     <0.5223,-0.6637,-0.5354>,
     <0.5175,-0.6623,-0.5418>,
     <0.5150,-0.6604,-0.5465>,
     <0.5212,-0.6557,-0.5463>,
     <0.5283,-0.6507,-0.5454>,
     <0.5265,-0.6504,-0.5475>,
     <0.5258,-0.6582,-0.5388>,
     <0.5125,-0.6571,-0.5527>,
     <0.5174,-0.6584,-0.5466>,
     <0.5010,-0.6580,-0.5621>,
     <0.5376,-0.6595,-0.5254>,
     <0.5256,-0.6511,-0.5475>,
     <0.5208,-0.6458,-0.5582>,
     <0.5231,-0.6730,-0.5229>,
     <0.4809,-0.6849,-0.5474>,
     <0.5475,-0.6387,-0.5406>,
     <0.5205,-0.6327,-0.5733>,
     <0.5518,-0.6599,-0.5099>,
     <0.5125,-0.6946,-0.5048>,
     <-0.5136,-0.6801,0.5232>
     }
   uv_vectors
   {
     25
<0.000000,0.000000>,
<0.250000,0.000000>,
<0.500000,0.000000>,
<0.750000,0.000000>,
<1.000000,0.000000>,
<0.000000,0.250000>,
<0.250000,0.250000>,
<0.500000,0.250000>,
<0.750000,0.250000>,
<1.000000,0.250000>,
<0.000000,0.500000>,
<0.250000,0.500000>,
<0.500000,0.500000>,
<0.750000,0.500000>,
<1.000000,0.500000>,
<0.000000,0.750000>,
<0.250000,0.750000>,
<0.500000,0.750000>,
<0.750000,0.750000>,
<1.000000,0.750000>,
<0.000000,1.000000>,
<0.250000,1.000000>,
<0.500000,1.000000>,
<0.750000,1.000000>,
<1.000000,1.000000>
   }
   face_indices
{
          32
     <0,1,5>,0,
     <1,6,5>,0,
     <1,2,6>,1,
     <2,7,6>,1,
     <2,3,7>,2,
     <3,8,7>,2,
     <3,4,8>,3,
     <4,9,8>,3,
     <5,6,10>,4,
     <6,11,10>,4,
     <6,7,11>,5,
     <7,12,11>,5,
     <7,8,12>,6,
     <8,13,12>,6,
     <8,9,13>,7,
     <9,14,13>,7,
     <10,11,15>,8,
     <11,16,15>,8,
     <11,12,16>,9,
     <12,17,16>,9,
     <12,13,17>,10,
     <13,18,17>,10,
     <13,14,18>,11,
     <14,19,18>,11,
     <15,16,20>,12,
     <16,21,20>,12,
     <16,17,21>,13,
     <17,22,21>,13,
     <17,18,22>,14,
     <18,23,22>,14,
     <18,19,23>,15,
     <19,24,23>,15
   }
   texture
   {
     uv_mapping pigment { P_BlueMarble_Section_n42e044 }
   }
   double_illuminate
   translate ApproxLook
}

...but why line 96? What have the uv_vectors to do with the face 
indices? WHY?!?

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Le Forgeron
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 14 Sep 2020 23:59:23
Message: <5f603c1b@news.povray.org>
Le 15/09/2020 à 05:45, Jörg "Yadgar" Bleimann a écrit :

> 
> ...but why line 96? What have the uv_vectors to do with the face
> indices? WHY?!?
> 

Check your syntax.

https://www.povray.org/documentation/view/3.6.1/293/

face_indices, as you use it, is providing a texture_index (either 0, 1
or 3 can be provided).

It is a waste when uv_indices is provided.

Especially as you do not have a texture_list section.


> See you in Khyberspace!
> 
> Yadgar


Post a reply to this message

From: Jörg "Yadgar" Bleimann
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 15 Sep 2020 00:18:12
Message: <5f604084$1@news.povray.org>
Hi(gh)!

On 15.09.20 05:59, Le_Forgeron wrote:

> It is a waste when uv_indices is provided.
> 
> Especially as you do not have a texture_list section.

But I have no uv_indices, just uv_vectors!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Bald Eagle
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 15 Sep 2020 07:00:01
Message: <web.5f609e1857afda211f9dae300@news.povray.org>
=?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:

http://wiki.povray.org/content/Reference:Mesh2

> But I have no uv_indices, just uv_vectors!

My guess is that you may be missing a section of data.
Perhaps POV-Ray creates uv-index data where it is missing, (<0, 0>?) and that
doesn't jive with whatever it needs to do.   Or it's just a bad/misleading
error.

Make a 2x2 or 3x3 mesh, or make an inc file to store your test mesh(es) in.
(just to keep the amount of text in the main pov file down.)
Then you can write a scene with various permutations and choose them with
#switch.

That way you never delete the mistakes, you don't repeat failed experiments, and
when something doesn't work, you can //comment that section with "Doesn't work"
and copy-paste the exact error into the comments as well.
It's easier than having 32 different pov files and trying to meaningfully name /
differentiate them all.
That way it's a record of what you tried and what you haven't yet, that can act
as a reference for you - and others if you post it.


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 15 Sep 2020 13:40:00
Message: <web.5f60fadb57afda216e3057d70@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> =?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:
>
> http://wiki.povray.org/content/Reference:Mesh2
>
> > But I have no uv_indices, just uv_vectors!
>
> My guess is that you may be missing a section of data.
> Perhaps POV-Ray creates uv-index data where it is missing, (<0, 0>?) and that
> doesn't jive with whatever it needs to do.   Or it's just a bad/misleading
> error.
> ...

Bill,

I have a suspicion that Yadgar does not read my replies, so I'll reply to you
instead.

Yadgar's problem is likely, like Jerome Grimbert explained, the unnecessary (?)
texture indices in his face_indices block. (I believe that Jerome Grimbert meant
to write "uv_vectors" when he wrote "uv_indices".)

POV-Ray complains, rightfully but not very comprehensible, when it reaches the
index to the first texture; because there is no texture_list block before the
face_indices block (as shown on the documentation page Jerome Grimbert linked
to).

What I find interesting though, is that it IS possible to combine UV-mapping and
a texture list: One can place several UV-mappable textures in the texture list
and then refer to each of them in the face_indices block thereafter.

I suspcet that this may be useful if one has several image map tiles that are to
be UV-mapped to different regions of the mesh.

Here's a complete scene that renders without problems if one provides an image
for the UV-mapping:

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 =======

#include "colors.inc"

global_settings { assumed_gamma 1.0 }

default {
    texture {
        finish {
            diffuse 0
            ambient color Black
            emission color White
        }
    }
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 =======

#declare Earth_Slice_n42e044 =
    mesh2 {
        vertex_vectors {
            25
            <  2884.8178, -40532.7525,  56082.6582>,
            < -9171.5619, -40308.4150,  44746.1601>,
            <-21188.6401, -40084.4363,  33366.7545>,
            <-32877.9350, -40230.5532,  21652.1961>,
            <-44580.6796, -40306.6256,   9952.5033>,
            < 13057.8787, -23755.4346,  45548.1452>,
            <  1330.1334, -23909.1988,  33947.0299>,
            <-10630.4449, -23708.0951,  22585.0805>,
            <-22695.4630, -23321.5223,  11326.5482>,
            <-34370.6821, -23387.2495,   -329.0233>,
            < 23221.9340,  -6962.3006,  35022.9578>,
            < 11316.8721,  -6836.8635,  23677.4411>,
            <  -399.8051,  -6905.9531,  12137.8952>,
            <-12333.4551,  -6640.1561,    818.8397>,
            <-24333.2326,  -6238.3055, -10436.7932>,
            < 33304.7484,   9943.2953,  24581.8979>,
            < 21837.6885,   9539.8892,  12858.6481>,
            <  9658.4610,  10127.7787,   1866.7320>,
            < -1845.2730,   9879.2958,  -9816.8170>,
            <-13884.9949,  10384.4651, -20958.2292>,
            < 43363.8318,  26887.7446,  14165.4121>,
            < 31606.8161,  26914.8515,   2812.8338>,
            < 19694.9660,  27199.3287,  -8382.2095>,
            <  9001.1538,  25928.0627, -20815.7556>,
            < -2940.1603,  26357.8266, -31979.7411>
        }
        normal_vectors {
            25
            < 0.5096, -0.6575, -0.5550>,
            < 0.5112, -0.6702, -0.5381>,
            < 0.4969, -0.6771, -0.5429>,
            < 0.5235, -0.6600, -0.5389>,
            < 0.5386, -0.6507, -0.5352>,
            < 0.5223, -0.6637, -0.5354>,
            < 0.5175, -0.6623, -0.5418>,
            < 0.5150, -0.6604, -0.5465>,
            < 0.5212, -0.6557, -0.5463>,
            < 0.5283, -0.6507, -0.5454>,
            < 0.5265, -0.6504, -0.5475>,
            < 0.5258, -0.6582, -0.5388>,
            < 0.5125, -0.6571, -0.5527>,
            < 0.5174, -0.6584, -0.5466>,
            < 0.5010, -0.6580, -0.5621>,
            < 0.5376, -0.6595, -0.5254>,
            < 0.5256, -0.6511, -0.5475>,
            < 0.5208, -0.6458, -0.5582>,
            < 0.5231, -0.6730, -0.5229>,
            < 0.4809, -0.6849, -0.5474>,
            < 0.5475, -0.6387, -0.5406>,
            < 0.5205, -0.6327, -0.5733>,
            < 0.5518, -0.6599, -0.5099>,
            < 0.5125, -0.6946, -0.5048>,
            <-0.5136, -0.6801,  0.5232>
        }
        uv_vectors {
            25
            <0.000000, 0.000000>,
            <0.250000, 0.000000>,
            <0.500000, 0.000000>,
            <0.750000, 0.000000>,
            <1.000000, 0.000000>,
            <0.000000, 0.250000>,
            <0.250000, 0.250000>,
            <0.500000, 0.250000>,
            <0.750000, 0.250000>,
            <1.000000, 0.250000>,
            <0.000000, 0.500000>,
            <0.250000, 0.500000>,
            <0.500000, 0.500000>,
            <0.750000, 0.500000>,
            <1.000000, 0.500000>,
            <0.000000, 0.750000>,
            <0.250000, 0.750000>,
            <0.500000, 0.750000>,
            <0.750000, 0.750000>,
            <1.000000, 0.750000>,
            <0.000000, 1.000000>,
            <0.250000, 1.000000>,
            <0.500000, 1.000000>,
            <0.750000, 1.000000>,
            <1.000000, 1.000000>
        }
        face_indices {
            32
            < 0,  1,  5>,
            < 1,  6,  5>,
            < 1,  2,  6>,
            < 2,  7,  6>,
            < 2,  3,  7>,
            < 3,  8,  7>,
            < 3,  4,  8>,
            < 4,  9,  8>,
            < 5,  6, 10>,
            < 6, 11, 10>,
            < 6,  7, 11>,
            < 7, 12, 11>,
            < 7,  8, 12>,
            < 8, 13, 12>,
            < 8,  9, 13>,
            < 9, 14, 13>,
            <10, 11, 15>,
            <11, 16, 15>,
            <11, 12, 16>,
            <12, 17, 16>,
            <12, 13, 17>,
            <13, 18, 17>,
            <13, 14, 18>,
            <14, 19, 18>,
            <15, 16, 20>,
            <16, 21, 20>,
            <16, 17, 21>,
            <17, 22, 21>,
            <17, 18, 22>,
            <18, 23, 22>,
            <18, 19, 23>,
            <19, 24, 23>
        }
    }

#declare pApproxLook = <-3295778.3537, 4308723.8277, 3353808.4183>;

object {
    Earth_Slice_n42e044
    texture {
        uv_mapping
        pigment {
            image_map {
                png "AnImage.png"
                gamma srgb
                map_type 0
                interpolate 2
                once
            }
        }
    }
    double_illuminate
    translate pApproxLook
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 =======

#declare pMin = min_extent(Earth_Slice_n42e044);
#declare pMax = max_extent(Earth_Slice_n42e044);
#declare pCtr = (pMin + pMax)/2;

camera {
    location 10000*<0, 10, 8>
    look_at <0, 0, 0>
    translate pCtr + pApproxLook
}

background { color Gray30 }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 =======

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 15 Sep 2020 13:55:01
Message: <web.5f60ffb757afda216e3057d70@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > ...
> > My guess is that you may be missing a section of data.
> > ...

> ...
> POV-Ray complains, rightfully but not very comprehensible, when it reaches the
> index to the first texture; because there is no texture_list block before the
> face_indices block (as shown on the documentation page Jerome Grimbert linked
> to).
> ...

So Bill, It seems that you guessed right...

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

From: Jörg "Yadgar" Bleimann
Subject: Re: Applying textures to a spherical heightfield section afterwards?
Date: 15 Sep 2020 20:17:46
Message: <5f6159aa$1@news.povray.org>
Hi(gh)!

On 15.09.20 19:33, Tor Olav Kristensen wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:

> I have a suspicion that Yadgar does not read my replies, 

Why shouldn't I? Of course I read any reply!

> Yadgar's problem is likely, like Jerome Grimbert explained, the unnecessary (?)
> texture indices in his face_indices block. (I believe that Jerome Grimbert meant
> to write "uv_vectors" when he wrote "uv_indices".)
> 
> POV-Ray complains, rightfully but not very comprehensible, when it reaches the
> index to the first texture; because there is no texture_list block before the
> face_indices block (as shown on the documentation page Jerome Grimbert linked
> to).
> 
> What I find interesting though, is that it IS possible to combine UV-mapping and
> a texture list: One can place several UV-mappable textures in the texture list
> and then refer to each of them in the face_indices block thereafter.
> 
> I suspcet that this may be useful if one has several image map tiles that are to
> be UV-mapped to different regions of the mesh.
> 
> Here's a complete scene that renders without problems if one provides an image
> for the UV-mapping:
> 
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 =======
> 
> #include "colors.inc"
> 
> global_settings { assumed_gamma 1.0 }
> 
> default {
>      texture {
>          finish {
>              diffuse 0
>              ambient color Black
>              emission color White
>          }
>      }
> }
> 
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 =======
> 
> #declare Earth_Slice_n42e044 =
>      mesh2 {
>          vertex_vectors {
>              25
>              <  2884.8178, -40532.7525,  56082.6582>,
>              < -9171.5619, -40308.4150,  44746.1601>,
>              <-21188.6401, -40084.4363,  33366.7545>,
>              <-32877.9350, -40230.5532,  21652.1961>,
>              <-44580.6796, -40306.6256,   9952.5033>,
>              < 13057.8787, -23755.4346,  45548.1452>,
>              <  1330.1334, -23909.1988,  33947.0299>,
>              <-10630.4449, -23708.0951,  22585.0805>,
>              <-22695.4630, -23321.5223,  11326.5482>,
>              <-34370.6821, -23387.2495,   -329.0233>,
>              < 23221.9340,  -6962.3006,  35022.9578>,
>              < 11316.8721,  -6836.8635,  23677.4411>,
>              <  -399.8051,  -6905.9531,  12137.8952>,
>              <-12333.4551,  -6640.1561,    818.8397>,
>              <-24333.2326,  -6238.3055, -10436.7932>,
>              < 33304.7484,   9943.2953,  24581.8979>,
>              < 21837.6885,   9539.8892,  12858.6481>,
>              <  9658.4610,  10127.7787,   1866.7320>,
>              < -1845.2730,   9879.2958,  -9816.8170>,
>              <-13884.9949,  10384.4651, -20958.2292>,
>              < 43363.8318,  26887.7446,  14165.4121>,
>              < 31606.8161,  26914.8515,   2812.8338>,
>              < 19694.9660,  27199.3287,  -8382.2095>,
>              <  9001.1538,  25928.0627, -20815.7556>,
>              < -2940.1603,  26357.8266, -31979.7411>
>          }
>          normal_vectors {
>              25
>              < 0.5096, -0.6575, -0.5550>,
>              < 0.5112, -0.6702, -0.5381>,
>              < 0.4969, -0.6771, -0.5429>,
>              < 0.5235, -0.6600, -0.5389>,
>              < 0.5386, -0.6507, -0.5352>,
>              < 0.5223, -0.6637, -0.5354>,
>              < 0.5175, -0.6623, -0.5418>,
>              < 0.5150, -0.6604, -0.5465>,
>              < 0.5212, -0.6557, -0.5463>,
>              < 0.5283, -0.6507, -0.5454>,
>              < 0.5265, -0.6504, -0.5475>,
>              < 0.5258, -0.6582, -0.5388>,
>              < 0.5125, -0.6571, -0.5527>,
>              < 0.5174, -0.6584, -0.5466>,
>              < 0.5010, -0.6580, -0.5621>,
>              < 0.5376, -0.6595, -0.5254>,
>              < 0.5256, -0.6511, -0.5475>,
>              < 0.5208, -0.6458, -0.5582>,
>              < 0.5231, -0.6730, -0.5229>,
>              < 0.4809, -0.6849, -0.5474>,
>              < 0.5475, -0.6387, -0.5406>,
>              < 0.5205, -0.6327, -0.5733>,
>              < 0.5518, -0.6599, -0.5099>,
>              < 0.5125, -0.6946, -0.5048>,
>              <-0.5136, -0.6801,  0.5232>
>          }
>          uv_vectors {
>              25
>              <0.000000, 0.000000>,
>              <0.250000, 0.000000>,
>              <0.500000, 0.000000>,
>              <0.750000, 0.000000>,
>              <1.000000, 0.000000>,
>              <0.000000, 0.250000>,
>              <0.250000, 0.250000>,
>              <0.500000, 0.250000>,
>              <0.750000, 0.250000>,
>              <1.000000, 0.250000>,
>              <0.000000, 0.500000>,
>              <0.250000, 0.500000>,
>              <0.500000, 0.500000>,
>              <0.750000, 0.500000>,
>              <1.000000, 0.500000>,
>              <0.000000, 0.750000>,
>              <0.250000, 0.750000>,
>              <0.500000, 0.750000>,
>              <0.750000, 0.750000>,
>              <1.000000, 0.750000>,
>              <0.000000, 1.000000>,
>              <0.250000, 1.000000>,
>              <0.500000, 1.000000>,
>              <0.750000, 1.000000>,
>              <1.000000, 1.000000>
>          }
>          face_indices {
>              32
>              < 0,  1,  5>,
>              < 1,  6,  5>,
>              < 1,  2,  6>,
>              < 2,  7,  6>,
>              < 2,  3,  7>,> so I'll reply to you
> instead.
> 

>              < 3,  8,  7>,
>              < 3,  4,  8>,
>              < 4,  9,  8>,
>              < 5,  6, 10>,
>              < 6, 11, 10>,
>              < 6,  7, 11>,
>              < 7, 12, 11>,
>              < 7,  8, 12>,
>              < 8, 13, 12>,
>              < 8,  9, 13>,
>              < 9, 14, 13>,
>              <10, 11, 15>,
>              <11, 16, 15>,
>              <11, 12, 16>,
>              <12, 17, 16>,
>              <12, 13, 17>,
>              <13, 18, 17>,
>              <13, 14, 18>,
>              <14, 19, 18>,
>              <15, 16, 20>,
>              <16, 21, 20>,
>              <16, 17, 21>,
>              <17, 22, 21>,
>              <17, 18, 22>,
>              <18, 23, 22>,
>              <18, 19, 23>,
>              <19, 24, 23>
>          }
>      }
> 
> #declare pApproxLook = <-3295778.3537, 4308723.8277, 3353808.4183>;
> 
> object {
>      Earth_Slice_n42e044
>      texture {
>          uv_mapping
>          pigment {
>              image_map {
>                  png "AnImage.png"
>                  gamma srgb
>                  map_type 0
>                  interpolate 2
>                  once
>              }
>          }
>      }
>      double_illuminate
>      translate pApproxLook
> }
> 
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 =======
> 
> #declare pMin = min_extent(Earth_Slice_n42e044);
> #declare pMax = max_extent(Ear> so I'll reply to you
> instead.
> 
th_Slice_n42e044);
> #declare pCtr = (pMin + pMax)/2;
> 
> camera {
>      location 10000*<0, 10, 8>
>      look_at <0, 0, 0>
>      translate pCtr + pApproxLook
> }
> 
> background { color Gray30 }
> 
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 =======
> 
> --
> Tor Olav
> http://subcube.com
> https://github.com/t-o-k
> 
> 

Yep, that's the ticket! I left out texture index in the face_indices 
block, and, whoopeee!, the whole thing runs perfectly! Thank you, Tor! 
I'll include you in my credits list!

See you in Khyberspace!

Yadgar


Post a reply to this message

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