Using The POV-Ray Lunar Explorer Program Script v6.0

Putting the Lunar Explorer script to use only involves changing a few settings and then running the script in POV-Ray v3.7.  Below are several examples of renderings using the POV-Ray Lunar Explorer script and related resource files with the settings given below each picture.

Even a small change in the view settings can dramatically alter the image.  All the examples below were made by only changing the view settings as shown.



Example 1:

Copy and paste the following settings block into the Lunar Explorer program and then run it to produce the above rendering.
// Last Quarter Moon

   #declare SunSkyAzm        = 270;
   #declare SunSkyAlt        = 0;
   #declare SelenoLat        = 0;
   #declare SelenoLng        = 0;
   #declare CamLocX          = 0;
   #declare CamLocY          = 0;
   #declare CamLocZ          = -MeanLunarDist;
   #declare CamLookUpDown    = 0;
   #declare CamLookLeftRight = 0;
   #declare CamRotate        = 0;
   #declare CamZoomFactor    = 1;
   #declare SunlightLevel    = 2.25;
   #declare EarthshineLevel  = 4/256;
   #declare AmbiLevel        = 0;
   #declare ReliefLevel      = 3.55;
   #declare MaxGradLevel     = 1.5;




Example 2:

Copy and paste the following settings block into the Lunar Explorer program and then run it to produce the above rendering.
// ------------------------------------------------------
// Phase 250 deg - North Plato region

   #declare SunSkyAzm        = 250;
   #declare SunSkyAlt        = 0;
   #declare SelenoLat        = 0;
   #declare SelenoLng        = 0;
   #declare CamLocX          = 0;
   #declare CamLocY          = 0;
   #declare CamLocZ          = -MeanLunarDist;
   #declare CamLookUpDown    = +600;
   #declare CamLookLeftRight = -150;
   #declare CamRotate        = 0;
   #declare CamZoomFactor    = 5.0;
   #declare SunlightLevel    = 2.55;
   #declare EarthshineLevel  = 3/256;
   #declare AmbiLevel        = 0;
   #declare ReliefLevel      = 4;
   #declare MaxGradLevel     = 1.5




Example 3:

Copy and paste the following settings block into the Lunar Explorer program and then run it to produce the above rendering.
// Phase 250 deg, S polar area 4x zoom

   #declare SunSkyAzm        = 250;
   #declare SunSkyAlt        = 0;
   #declare SelenoLat        = 0;
   #declare SelenoLng        = 0;
   #declare CamLocX          = 0;
   #declare CamLocY          = 0;
   #declare CamLocZ          = -MeanLunarDist;
   #declare CamLookUpDown    = -535;
   #declare CamLookLeftRight = 0;
   #declare CamRotate        = 0;
   #declare CamZoomFactor    = 4;
   #declare SunlightLevel    = 2.0;
   #declare EarthshineLevel  = 3/512;
   #declare AmbiLevel        = 0;
   #declare ReliefLevel      = 3.55;
   #declare MaxGradLevel     = 1.5;




Example 4:

Copy and paste the following settings block into the Lunar Explorer program and then run it to produce the above rendering.
   Mare Orientale 2.5x zoom

   #declare SunSkyAzm        = 250;
   #declare SunSkyAlt        = 0;
   #declare SelenoLat        = 0;
   #declare SelenoLng        = 270;
   #declare CamLocX          = 0;
   #declare CamLocY          = 0;
   #declare CamLocZ          = -MeanLunarDist;
   #declare CamLookUpDown    = -250;
   #declare CamLookLeftRight = -150;
   #declare CamRotate        = 0;
   #declare CamZoomFactor    = 2.5;
   #declare SunlightLevel    = 2.25;
   #declare EarthshineLevel  = 0;
   #declare AmbiLevel        = 0;
   #declare ReliefLevel      = 11;
   #declare MaxGradLevel     = 1.5;




Example 5:

Copy and paste the following settings block into the Lunar Explorer program and then run it to produce the above rendering.
// Tsiolkovski Crater - Far side

   #declare SunSkyAzm        = 288;
   #declare SunSkyAlt        = 0;
   #declare SelenoLat        = 0;
   #declare SelenoLng        = 160;
   #declare CamLocX          = 0;
   #declare CamLocY          = 0;
   #declare CamLocZ          = -MeanLunarDist;
   #declare CamLookUpDown    = -250;
   #declare CamLookLeftRight = -350;
   #declare CamRotate        = 0;
   #declare CamZoomFactor    = 4;
   #declare SunlightLevel    = 2.25;
   #declare EarthshineLevel  = 0;
   #declare AmbiLevel        = 0;
   #declare ReliefLevel      = 11;
   #declare MaxGradLevel     = 1.5;




Example 6:

Copy and paste the following settings block into the Lunar Explorer program and then run it to produce the above rendering.
// Phase 72 deg

   #declare SunSkyAzm        = 72;
   #declare SunSkyAlt        = 0;
   #declare SelenoLat        = 0;
   #declare SelenoLng        = 0;
   #declare CamLocX          = 0;
   #declare CamLocY          = 0;
   #declare CamLocZ          = -MeanLunarDist;
   #declare CamLookUpDown    = 0;
   #declare CamLookLeftRight = 0;
   #declare CamRotate        = 0;
   #declare CamZoomFactor    = 1;
   #declare SunlightLevel    = 2.34;
   #declare EarthshineLevel  = 4/256;
   #declare AmbiLevel        = 0;
   #declare ReliefLevel      = 3.57;
   #declare MaxGradLevel     = 1.5;




Example 7:

Copy and paste the following settings block into the Lunar Explorer program and then run it to produce the above rendering.
// Phase 72 deg - South polar area 2.25x zoom

   #declare SunSkyAzm        = 72;
   #declare SunSkyAlt        = 0;
   #declare SelenoLat        = 0;
   #declare SelenoLng        = 0;
   #declare CamLocX          = 0;
   #declare CamLocY          = 0;
   #declare CamLocZ          = -MeanLunarDist;
   #declare CamLookUpDown    = -400;
   #declare CamLookLeftRight = +350;
   #declare CamRotate        = 0;
   #declare CamZoomFactor    = 2.25;
   #declare SunlightLevel    = 2.25;
   #declare EarthshineLevel  = 3/512;
   #declare AmbiLevel        = 0;
   #declare ReliefLevel      = 3.57;
   #declare MaxGradLevel     = 1.5;




Example 8:

Copy and paste the following settings block into the Lunar Explorer program and then run it to produce the above rendering.
// Phase 120 deg, N zoom

   #declare SunSkyAzm        = 72;
   #declare SunSkyAlt        = 0;
   #declare SelenoLat        = 0;
   #declare SelenoLng        = 180;
   #declare CamLocX          = 0;
   #declare CamLocY          = 0;
   #declare CamLocZ          = -MeanLunarDist;
   #declare CamLookUpDown    = 0;
   #declare CamLookLeftRight = 0;
   #declare CamRotate        = 0;
   #declare CamZoomFactor    = 2;
   #declare SunlightLevel    = 2.25;
   #declare EarthshineLevel  = 0;
   #declare AmbiLevel        = 0;
   #declare ReliefLevel      = 3.55;
   #declare MaxGradLevel     = 1.5;




Example 9:

Copy and paste the following settings block into the Lunar Explorer program and then run it to produce the above rendering.
// Far side phase 270 deg South zoom 2.9x

   #declare SunSkyAzm        = 270;
   #declare SunSkyAlt        = 0;
   #declare SelenoLat        = 0;
   #declare SelenoLng        = 180;
   #declare CamLocX          = 0;
   #declare CamLocY          = 0;
   #declare CamLocZ          = -MeanLunarDist;
   #declare CamLookUpDown    = -455;
   #declare CamLookLeftRight = -250;
   #declare CamRotate        = 0;
   #declare CamZoomFactor    = 2.9;
   #declare SunlightLevel    = 2.25;
   #declare EarthshineLevel  = 0;
   #declare AmbiLevel        = 0;
   #declare ReliefLevel      = 3.55;
   #declare MaxGradLevel     = 1.5;




Example 10:

Copy and paste the following settings block into the Lunar Explorer program and then run it to produce the above rendering.
// Phase 210 deg, far side, south up zoom 12x

   #declare SunSkyAzm        = 210;
   #declare SunSkyAlt        = 0;
   #declare SelenoLat        = 0;
   #declare SelenoLng        = 180;
   #declare CamLocX          = 0;
   #declare CamLocY          = 0;
   #declare CamLocZ          = -MeanLunarDist;
   #declare CamLookUpDown    = +650;
   #declare CamLookLeftRight = +25;
   #declare CamRotate        = 180;
   #declare CamZoomFactor    = 12;
   #declare SunlightLevel    = 2.25;
   #declare EarthshineLevel  = 0;
   #declare AmbiLevel        = 0;
   #declare ReliefLevel      = 11;
   #declare MaxGradLevel     = 1.5;



Below is a complete listing of the POV-Ray Lunar Explorer v6 source code that generated ALL of the above images.  It is included with all the necessary graphics resources in the full POV-Ray Lunar Explorer package available for download on THIS page.

/*
  POV-Ray Lunar Explorer v6.0

  This program renders the lunar sphere using a spherical isosurface
  with height field to provide real 3D surface relief.

  Author   : Jay Tanner 2014
  Language : POV-Ray v3.7 or v3.6

  License  : This source code is released under the provisions of the
             Creative Commons Attribution-ShareAlike 3.0 license.
             http://creativecommons.org/licenses/by-sa/3.0/legalcode

  For the lunar phases:
  Phase Angle (=SunSkyAzm): 0=New, 90=FQ, 180=Full, 270=LQ

  This program can be used as a starting template.

  An attempt was made to keep the program code as simple as possible. If
  all comments are removed, the entire program consists of only 59 lines.

  ============================================================================
*/

   #version 3.7; // Delete this line if using POV-Ray v3.6

// -------------------------------------------
// These settings may be customized as needed.

   #global_settings {max_trace_level 1   assumed_gamma 1}

// ---------------------------------------------------------
// Set natural parameters and geocentric distances in miles.

   #declare EquRadius  = 1080.0;
   #declare PolRadius  = 1078.7;
   #declare MeanRadius = (EquRadius + PolRadius) / 2;

   #declare MinLunarDist  = 225745; // perigee
   #declare MaxLunarDist  = 251967; // apogee
   #declare MeanLunarDist = (MinLunarDist + MaxLunarDist) / 2;

   #declare MeanSolarDist = 92955807; // = 1 AU

// ----------------------------------------------------------
// ----------------------------------------------------------
// Last Quarter Moon - Phase 270 deg

   #declare SunSkyAzm        = 270;
   #declare SunSkyAlt        = 0;
   #declare SelenoLat        = 0;
   #declare SelenoLng        = 0;
   #declare CamLocX          = 0;
   #declare CamLocY          = 0;
   #declare CamLocZ          = -MeanLunarDist;
   #declare CamLookUpDown    = 0;
   #declare CamLookLeftRight = 0;
   #declare CamRotate        = 0;
   #declare CamZoomFactor    = 1;
   #declare SunlightLevel    = 2.25;
   #declare EarthshineLevel  = 4/256;
   #declare AmbiLevel        = 0;
   #declare ReliefLevel      = 3.57;
   #declare MaxGradLevel     = 1.5;

// =========================================================================
// Define space background color and sun and earthshine light sources.

   background {rgb <0, 0, 0>}

   #declare SunSkyAzm = (180 - SunSkyAzm) * pi/180;
   #declare SunSkyAlt = SunSkyAlt * pi/180;

   #declare X =  MeanSolarDist * cos(SunSkyAlt) * sin(SunSkyAzm);
   #declare Y =  MeanSolarDist * sin(SunSkyAlt);
   #declare Z = -MeanSolarDist * cos(SunSkyAlt) * cos(SunSkyAzm);

   light_source {<X,Y,Z>   rgb <1,1,1> * SunlightLevel}

   light_source {<0, 0, -MeanLunarDist>   rgb <1,1,1> * EarthshineLevel}

// =========================================================================
// Define a simple telescopic camera.

   camera
{
   location <CamLocX, CamLocY, CamLocZ>

   look_at <CamLookLeftRight, CamLookUpDown, 0>

   rotate <0, 0, CamRotate>

   angle 0.456 / CamZoomFactor
}

// =========================================================================
// Define a lunar sphere with 3D relief via isosurface with height field.

   #declare Lunar_Sphere = function {internal(61)}

   #declare Lunar_Height_Field = function
{
   pigment{image_map{png "lunar_surface_DEM_gray.png" map_type 1 interpolate 2}}
}

   isosurface
{
   function {Lunar_Sphere(x,y,z, EquRadius)
           - Lunar_Height_Field(x,y,z).gray*ReliefLevel/1000*EquRadius + 0.35*EquRadius}

   contained_by {sphere{0, EquRadius}}

   max_gradient MaxGradLevel

   accuracy 1/14500

   scale <1, PolRadius/EquRadius, 1>

   texture
  {
   pigment {image_map {jpeg "lunar_surface_texture.jpg" map_type 1}}
// pigment {image_map {png  "lunar_surface_DEM_16.png"  map_type 1}}


   finish {diffuse 1.25   ambient AmbiLevel}
  }
   rotate y * (SelenoLng - 90)
   rotate x * (-SelenoLat)
}

// -----

Jay Tanner - 2015