POV-Ray : Newsgroups : povray.general : Generate Digital Elevation Model Server Time
24 Nov 2024 08:22:55 EST (-0500)
  Generate Digital Elevation Model (Message 1 to 3 of 3)  
From: angie866
Subject: Generate Digital Elevation Model
Date: 9 Oct 2019 07:00:00
Message: <web.5d9dbcfe26e3db7ad2367ba0@news.povray.org>
Hello everybody,

I want to generate an image of the Moon which has the exact shape of it: I want
to add a digital elevation model to my spherical Moon.

My code so far is:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

#version 3.7;
#global_settings {max_trace_level 1 assumed_gamma 1}
#include "colors.inc"

#declare MoonRad_x = 1737.4;
#declare MoonRad_y = 1737.4;
#declare MoonRad_z = 1737.4;
#declare CAM_X = -0.000000;
#declare CAM_Y = -0.000000;
#declare CAM_Z = -0.000000;
#declare Moon_X = -21887.888175;
#declare Moon_Y = 41664.398682;
#declare Moon_Z = -15652.293228;
#declare SUN_X = -139073938.658433;
#declare SUN_Y = 54871282.096690;
#declare SUN_Z = 23773527.242084;
#declare ROT_X = 0.004860;
#declare FOV = 6;

#declare Object = sphere{ <0,0,0>, 1
scale <MoonRad_x,MoonRad_y,MoonRad_z>
texture {pigment {image_map {jpeg "moon.jpg" map_type 1}}
finish {diffuse 1.25 ambient 0}
rotate <0,ROT_X,0>}
translate <Moon_X,Moon_Y,Moon_Z>
 }
Object // Create Moon

camera {
location <CAM_X,CAM_Y,CAM_Z>
right x
up y
look_at <Moon_X,Moon_Y,Moon_Z>
angle FOV
 focal_point <0,0,0.000127>
 }

background {color Black}
light_source {<SUN_X,SUN_Y,SUN_Z> color White parallel }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Is there a way to attach to the sphere a certain height to generate the real
height of the moon? Or is there another way to do it? I have the data of the
digital elevation model from LOLA
Instrument in a .img file (from
https://pds-geosciences.wustl.edu/lro/lro-l-lola-3-rdr-v1/lrolol_1xxx/data/lola_gdr/cylindrical/img/)

Thank you to everybody who wants to help me.
Mauro


Post a reply to this message

From: Bald Eagle
Subject: Re: Generate Digital Elevation Model
Date: 9 Oct 2019 14:10:00
Message: <web.5d9e2191fa5ba90b4eec112d0@news.povray.org>
"angie866" <mde### [at] gmailcom> wrote:

> Is there a way to attach to the sphere a certain height to generate the real
> height of the moon?
> Or is there another way to do it? I have the data of the
> digital elevation model from LOLA
> Instrument in a .img file (from
>
https://pds-geosciences.wustl.edu/lro/lro-l-lola-3-rdr-v1/lrolol_1xxx/data/lola_gdr/cylindrical/img/)
>
> Thank you to everybody who wants to help me.
> Mauro

Well, based on this
https://www.loc.gov/preservation/digital/formats/fdd/fdd000420.shtml

and

https://web.archive.org/web/20070801195300/http://home.gdal.org/projects/imagine/img2tif_src.zip

You might have a shot at subdividing the sphere surface into a rectangular mesh,
and using tif heightfields.

But that would be a LOT of work, and use a lot of memory and parsing/rendering
time.

Maybe just find a bump map of the moon and uv-map the sphere, using the bump-map
to create the normals.

http://planetpixelemporium.com/earth.html


Post a reply to this message

From: Thomas de Groot
Subject: Re: Generate Digital Elevation Model
Date: 10 Oct 2019 02:48:14
Message: <5d9ed42e$1@news.povray.org>
Op 09/10/2019 om 20:06 schreef Bald Eagle:
> 
> "angie866" <mde### [at] gmailcom> wrote:
> 
>> Is there a way to attach to the sphere a certain height to generate the real
>> height of the moon?
>> Or is there another way to do it? I have the data of the
>> digital elevation model from LOLA
>> Instrument in a .img file (from
>>
https://pds-geosciences.wustl.edu/lro/lro-l-lola-3-rdr-v1/lrolol_1xxx/data/lola_gdr/cylindrical/img/)
>>
>> Thank you to everybody who wants to help me.
>> Mauro
> 
> Well, based on this
> https://www.loc.gov/preservation/digital/formats/fdd/fdd000420.shtml
> 
> and
> 
>
https://web.archive.org/web/20070801195300/http://home.gdal.org/projects/imagine/img2tif_src.zip
> 
> You might have a shot at subdividing the sphere surface into a rectangular mesh,
> and using tif heightfields.
> 
> But that would be a LOT of work, and use a lot of memory and parsing/rendering
> time.
> 
> Maybe just find a bump map of the moon and uv-map the sphere, using the bump-map
> to create the normals.
> 
> http://planetpixelemporium.com/earth.html
> 
> 

I absolutely second that. See for instance: 
https://astrogeology.usgs.gov/search?pmi-target=moon

It has been 20 years since I last used dem data; I even must have a 
couple of discs somewhere with the whole US on them ;-) The point is 
that POV-Ray cannot use dem data directly in a height_field. You need to 
convert them first to a tga image file and then use that as a spherical 
height_field. The USGS used to provide a little utility just to do that 
conversion with their data, called DEM2TGA.EXE, iirc. However, my 
address to USGS seems to have gone dead so I cannot provide it immediately.

fwiw, see also: http://www.viewfinderpanoramas.org/dem3.html

-- 
Thomas


Post a reply to this message

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