POV-Ray : Newsgroups : povray.newusers : Wrapping A Hieght Field Object Around an elipsoid object : Re: Wrapping A Hieght Field Object Around an elipsoid object Server Time
31 Jul 2024 04:19:30 EDT (-0400)
  Re: Wrapping A Hieght Field Object Around an elipsoid object  
From: James Patterson
Date: 26 Jan 2003 07:05:20
Message: <3e33cf00$1@news.povray.org>
"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3E339E1F.2AE8F2D9@gmx.de...
> That macros take a function for defining the elevation.  Something like:
>
> #declare fn_Earth=function {
>   pigment {
>     image_map {
>       png "elevation.png"
>       interpolate 2
>     }
>   }
> }
>
> should work.

Tried that and kept getting error in rendering.  Gave up on HF_Sphere and
tried it with isosurface instead.  It works, but renders real slow.

here is the coding I used (your will need to get your own image maps to test
this)

#include "colors.inc"
#include "shapes.inc"

      camera{
    location <0, 0, 2.25>
    look_at <0, 0, 0>
    //angle 30
  }

   light_source{ <-10,0,15> White }



#declare earthrotate =180;  //allows me to rotate to desired part of planet
#declare height_scale = .001; //controls the height of surface features


 //This declaration gives me the coloring for the final product
#declare land = pigment {
                         image_map {
                                    jpeg "ev11612_land_ocean_ice_8192.jpg"
                                    map_type 1
                                    interpolate 2
                         }
                         rotate y*earthrotate
}

 //This declaration gives me the function to alter the surface of the
isosurface sphere below
#declare fn_elevation = function {
                                  pigment {
                                            image_map {
                                                       jpeg
"earthbump10k.jpeg"
                                                       map_type 1
                                                       interpolate 2
                                            }
                                  rotate y*earthrotate
                                  }
}


 //This is where the magic happens
isosurface {
            function {f_sphere(x, y, z, 1)-fn_elevation(x/2, y/2,
z/2).gray*height_scale}  // function (can also contain declared functions
            contained_by { sphere { 0, 1.1 } }  // container shape
            accuracy 0.0005                      // accuracy of calculation
[0.001]
            max_gradient 5                      // maximum gradient the
function can have [1.1]
            //evaluate 5, 1.2, 0.95             // evaluate the maximum
gradient
            all_intersections                 // alternative to 'max_trace'
            //pigment {White}             //allows viewing of surface
deformations only
            pigment {land}                 //displays earth's surface
}


Post a reply to this message

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