POV-Ray : Newsgroups : povray.advanced-users : Constraining an image map to a certain region of a sphere? Server Time
16 May 2024 10:31:31 EDT (-0400)
  Constraining an image map to a certain region of a sphere? (Message 1 to 4 of 4)  
From: Jörg 'Yadgar' Bleimann
Subject: Constraining an image map to a certain region of a sphere?
Date: 20 Jul 2013 04:51:30
Message: <51ea4f92$1@news.povray.org>
Hi(gh)!

The problem: I want to project a square image_map, which is a 
heightfield covering one square degree of ASTER elevation data, onto a 
sphere, not onto the entire sphere, but instead onto the geographic 
coordinate range defined by the elevation data tile.



shall have the texture, all other parts of the sphere shall remain 
textureless.

To avoid misunderstanding: I do not want to create a curved 
"heightfield" (this I already have achieved), but a "geographically" 
constrained pigment function which then will be used for an isosurface.

Is this doable at all with POV-Ray? Obviously, Christoph Hormann must 
have done it with the terrain renderings on his "Imagico" pages: 
http://earth.imagico.de/technical.php

I can't imagine that he used an isosurface covering the entire Earth, as 
billions of height data points would have to be processed, which simply 
would be beyond the capacities of today's PCs...

See you in Khyberspace!

Yadgar


Post a reply to this message

From: clipka
Subject: Re: Constraining an image map to a certain region of a sphere?
Date: 20 Jul 2013 04:58:06
Message: <51ea511e@news.povray.org>

> Hi(gh)!
>
> The problem: I want to project a square image_map, which is a
> heightfield covering one square degree of ASTER elevation data, onto a
> sphere, not onto the entire sphere, but instead onto the geographic
> coordinate range defined by the elevation data tile.
>


> shall have the texture, all other parts of the sphere shall remain
> textureless.

applying spherical warp to a scaled-down version of the image map (with 
the "once" keyword) might do the trick.


Post a reply to this message

From: Alain
Subject: Re: Constraining an image map to a certain region of a sphere?
Date: 20 Jul 2013 12:38:34
Message: <51eabd0a$1@news.povray.org>


>> Hi(gh)!
>>
>> The problem: I want to project a square image_map, which is a
>> heightfield covering one square degree of ASTER elevation data, onto a
>> sphere, not onto the entire sphere, but instead onto the geographic
>> coordinate range defined by the elevation data tile.
>>


>> shall have the texture, all other parts of the sphere shall remain
>> textureless.
>
> applying spherical warp to a scaled-down version of the image map (with
> the "once" keyword) might do the trick.
>

Next, you may translate verticaly to apply the image to the correct 
latitude: translate sin(radians(Latitude))*y. For the longitude, a 
simple rotate Longitude*y will do.


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Constraining an image map to a certain region of a sphere?
Date: 20 Jul 2013 17:18:21
Message: <51eafe9d$1@news.povray.org>
Hi(gh)!

On 20.07.2013 10:57, clipka wrote:

> applying spherical warp to a scaled-down version of the image map (with
> the "once" keyword) might do the trick.

Yes, it does! Here is what I programmed after your post:

// begin of code

#declare lat=0;
#declare long=20;

sphere
{
   0, 1
   texture
   {
     pigment
     {
       color rgb <0, 0, 1>
     }
   }
   texture
   {
     pigment
     {
       image_map
       {
         png "testimg.png"
         interpolate 2
         once
       }
       scale <1/360, 1/180, 1>
       translate <(180+long)/360, (90+lat)/180, 0>
       warp
       {
         spherical
         orientation z
         dist_exp 0
       }
       rotate <0, 90, 0>
     }
   }
}

light_source
{
   <0, 0, 1000>
   color rgb 1
}

camera
{
   location <0, 0, 4>
   look_at 0
}

// end of code

This worked fine... but when I tried to use this pigment as an 
isosurface function (yes, of course subtracted from a sphere function!), 
all I got was a featureless sphere, only a hint of relief visible at the 
terminator (grainy shadows) which, on the other hand, indicates that the 
function was *not* constrained to a defined geographical region on the 
sphere! Strange!

(as this is not a binary group, I added a f'up to p.b.i)

See you in Khyberspace!

Yadgar

Now playing: My Own Way, album version (Duran Duran)


Post a reply to this message

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