POV-Ray : Newsgroups : povray.binaries.images : Applying textures to a spherical heightfield section afterwards? Server Time
23 Dec 2024 18:45:44 EST (-0500)
  Applying textures to a spherical heightfield section afterwards? (Message 1 to 10 of 17)  
Goto Latest 10 Messages Next 7 Messages >>>
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?".



avoid opinion, care not what the neighbors think, never mind the unguessable



― Robert Heinlein


Post a reply to this message

Goto Latest 10 Messages Next 7 Messages >>>

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