POV-Ray : Newsgroups : povray.newusers : Wrapping A Hieght Field Object Around an elipsoid object Server Time
31 Jul 2024 08:27:18 EDT (-0400)
  Wrapping A Hieght Field Object Around an elipsoid object (Message 11 to 16 of 16)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: James Patterson
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 26 Jan 2003 07:07:18
Message: <3e33cf76$1@news.povray.org>
Tried that and kept getting  same 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

From: James Patterson
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 26 Jan 2003 07:10:00
Message: <3e33d018$1@news.povray.org>
"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3E33CB1C.1ADD13F5@gmx.de...
> That is a pigment function and the HF macros expect a float function.
> Try:
>
> HF_Sphere (
>   function { Function(x, y, z).gray },
>   UseUVheight,
>   UseUVtexture,
>   Res,Smooth,
>   FileName,
>   Center,
>   Radius,
>   Depth
>)

Tried that as well and got another 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

From: James Patterson
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 26 Jan 2003 07:38:13
Message: <3e33d6b5$1@news.povray.org>
Gave up on HF_Sphere and tried it with isosurface instead.  It works, but
renders real slow.

here is the coding I used (you 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
}

> This does sound interesting! I don't think its unrealistic, after all, POV
can
> calculate almost everything, though it can get very slow. I'm also one of
those
> geeks who tries to stay in POV-Code all the time! :-)
> Your idea sounds pretty neat, have you thought about making it possible
for
> other planets? I mean, does the system load maps of some sort, or does it
just
> take two poles and a sun-heading into account... If it does reply to a
heightfield-
> like sphere, it might be interesting to fumble with other planets...
> You're sparking me some ideas man! :-)
>
Will keep you posted then on my progress.  Currently my "simulation" would
work on any spherical object since I am really only manipulating
a simple cloud texture.  I will try to keep this as general a simulation as
possible to allow it's use universally.  The only part I am somewhat
satisfied with is the cloud motion when the sun is always at the equator.
Cloud formation is independent of insolation which was my second goal of
realistic cloud formation.  Before I start on that, however, I will need to
get the "coriolis force" responding properly to changes in axial tilt.


Post a reply to this message

From: hughes, b 
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 26 Jan 2003 07:54:04
Message: <3e33da6c$1@news.povray.org>
Thanks to Christoph I kept at it with the idea of using the
Function(x,y,z).gray way. I was trying that too, like you James, and getting
a similar error as before, only about float instead of vector. I was being
real sloppy about all this at first anyhow so I redid the whole thing and
added a step between the function declaration and the macro. Fixed and is
fast, aside from increased parse time.

#include "shapes.inc"

#declare f_Image=function {
 pigment {
  image_map {
   png "c:\images\test.png"
  }
 }
}
#declare Image=function {f_Image(x,y,z).gray} // needs this done ahead of
time

object {
HF_Sphere (Image, off, off, <100,100>, on, "", <0,0,0>, 0.9, 0.1)
pigment {rgb 1}
}


Post a reply to this message

From: Warp
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 26 Jan 2003 11:30:22
Message: <3e340d1e@news.povray.org>
This is how it has to be done. I hope James gets it working. Using an
isosurface is like killing flies with a cannon. :)

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: James Patterson
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 26 Jan 2003 23:38:06
Message: <3e34b7ae$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3e340d1e@news.povray.org...
>   This is how it has to be done. I hope James gets it working. Using an
> isosurface is like killing flies with a cannon. :)
>

AMEN!!

If you take the HF_Sphere macro and output the mesh to a new include file
then you save
all kinds of rendering time by simply reusing the original output file.
(This could end up saving me hours of animation time later on) I did find
howerver, that once you have optomized the isosurface code, it parses and
renders much faster (the first time anyway) than a comparable
quality HS_Sphere.  In fact for a single frame render, I prefer the
isosurface.  However, since I will be using this in a future animation, the
HF_Sphere is the best solution.   Special thanks to Warp, Christoph Hormann,
and epically hughes, b for sticking to the problem until you found a
solution in spite of my last post.  It is always good to have more than one
way to solve a problem.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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