POV-Ray : Newsgroups : povray.newusers : How can I apply a map of earth on a sphere? : Re: How can I apply a map of earth on a sphere? Server Time
30 Jul 2024 20:25:30 EDT (-0400)
  Re: How can I apply a map of earth on a sphere?  
From:
Date: 4 Oct 2003 23:49:43
Message: <3f7f94d7$1@news.povray.org>
// Hi Christian,
//
// renderings of earth and other planets (stand-alone or for an
// orrery) are posted in the POV-Ray newsgroups from time to time,
// for example "rendering mars" in p.b.i., 2003/15/08, by Christoph
// Hormann.
//
// These sections of the documentation will be relevant for you:
//
// 6.7.1.5 Image Maps
// 6.7.12.6.5 Mapping using warps
// 6.7.12.7 Bitmap modifiers
//
// The following code is a complete scene illustrating all this.
// The first (left) sphere has a simple image map; the second
// (right) sphere has a planar image map "warped" onto it; this
// is much more flexible.
//
// Searching for "DEM" or "Digital Elevation Map" in the POV-Ray
// newsgroups will give you some hints for a "bumpy" earth.
//
//    Sputnik



// spheres with image maps

// +SP8 +EP8 +A0.1 +AM2 +R3 -FN +D


sphere { 0, 1
  pigment {
    image_map {
      png "povmap.png" // in standard POV-Ray include directory
      map_type 1 // spherical mapping
      interpolate 2 // bilinear
      }
    }
  finish { ambient .4 diffuse .8 }
  translate -1.3*x
  }


#declare Rows = 4;
#declare Columns = 5;

sphere { 0, 1

  pigment {

    // get a planar image from <0,0> to <1,1>
    image_map {
      png "povmap.png"
      //once
      map_type 0 // planar mapping
      interpolate 2 // bilinear
      }

    // shrink to get Rows*Columns images into <0,0> to <1,1>
    scale <1/Columns, 1/Rows, 1>

    // also try this rotation!
    //rotate 30*z

    // use this translation together with "once" (in image_map above)
    //translate <.75, .5, 0>

    // wrap it around a sphere centered at <0,0,0>
    warp { spherical } // "warp", not "wrap"!

    }//pigment

  finish { ambient .4 diffuse .8 }
  translate 1.3*x

  }//sphere


background { color 1 }
light_source { <-10, 3, -6>, 1 }
camera { location <4, 4, -7> look_at 0 angle 30 }


Post a reply to this message

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