POV-Ray : Newsgroups : povray.newusers : Wrapping A Hieght Field Object Around an elipsoid object Server Time
24 Dec 2024 13:34:48 EST (-0500)
  Wrapping A Hieght Field Object Around an elipsoid object (Message 1 to 10 of 16)  
Goto Latest 10 Messages Next 6 Messages >>>
From: James Patterson
Subject: Wrapping A Hieght Field Object Around an elipsoid object
Date: 25 Jan 2003 17:38:12
Message: <3e3311d4@news.povray.org>
I am a high school computer teacher and am interested in using pov-ray with
my students to model the planet earth.  I have been successful in creating a
cut-away view of the earth and have created an animation showing the earth
rotating into the night complete with the appearance of city lights. I am
also working on a global weather simulation which has a long way to go.  My
question is about the possibility of wrapping a height field of the earths
surface topography onto a spherical shape.  I would like my students to be
able to experiment with issues like the difference between global elevations
as they really are compared to pictures and illustrations which exaggerate
the vertical scale. Is there a way to do this?


Post a reply to this message

From: Warp
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 25 Jan 2003 18:09:21
Message: <3e331921@news.povray.org>
James Patterson <jam### [at] covenantchristianorg> wrote:
> My
> question is about the possibility of wrapping a height field of the earths
> surface topography onto a spherical shape.  I would like my students to be
> able to experiment with issues like the difference between global elevations
> as they really are compared to pictures and illustrations which exaggerate
> the vertical scale. Is there a way to do this?

  The HF_Sphere() macro in shapes.inc has been designed for this purpose.
See the documentation about standard include files and shapes.inc.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Tim Nikias
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 25 Jan 2003 18:30:19
Message: <3e331e0b@news.povray.org>
Have you got a heightfield for the earth?
Its a map where white colors indicate highest
points and black colors indicate lowest points.

If not, mail me, and I'll send one to you. Its
2000x1000 with 256 gray-tones, jpeg, 306 kb,
but I'm not sure if it is suited for your purposes.

Care to give some more details of your
weather simulation? I'm very much interested in what
you're trying to go for, realism, or rather, a more fun
and explanatory style? And to which degree (actual
snowfall, or just "cold vs warm temperatures" - and
that "just" isn't meant to imply that its a simple task)...

Regards,
Tim


--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde

> I am a high school computer teacher and am interested in using pov-ray with
> my students to model the planet earth.  I have been successful in creating a
> cut-away view of the earth and have created an animation showing the earth
> rotating into the night complete with the appearance of city lights. I am
> also working on a global weather simulation which has a long way to go.  My
> question is about the possibility of wrapping a height field of the earths
> surface topography onto a spherical shape.  I would like my students to be
> able to experiment with issues like the difference between global elevations
> as they really are compared to pictures and illustrations which exaggerate
> the vertical scale. Is there a way to do this?
>
>


Post a reply to this message

From: James Patterson
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 25 Jan 2003 19:11:16
Message: <3e3327a4$1@news.povray.org>
"Tim Nikias" <tim### [at] gmxde> wrote in message
news:3e331e0b@news.povray.org...
> Have you got a heightfield for the earth?

I have been able to locate one showing the elevations above sea level but
one including the portion under the oceans would be great, then I could have
my students experiment with modeling changes in ocean levels as well.

> Care to give some more details of your
> weather simulation? I'm very much interested in what
> you're trying to go for, realism, or rather, a more fun
> and explanatory style? And to which degree (actual
> snowfall, or just "cold vs warm temperatures" - and
> that "just" isn't meant to imply that its a simple task)...

Your telling me!  Currently, I am simply trying to simulate cloud formation
and motions due to the coriolis force and global insolation (the amount of
sun light striking the earth at any given time.)  The clouds start out as
simple textures applied to various spheres representing different levels of
the earths atmosphere.  I believe I have a relatively accurate
representation of cloud motion, however, at the tropics I have way to many
clouds.  Eventually, I would like to have some interaction between the
atmosphere and the ocean as well as the land once I get this Height field
issue figured out. I would like my students to aim for a realistic as
possible simulation which is why I'm trying to do this on my own first so I
can help them through the tough parts.  Keep in mind I am trying to do all
of this from within POV-Ray which may be an unrealistic goal on my part.

Rendering is already painfully slow, but I am sure I am not writing the code
as efficiently as possible.


Post a reply to this message

From: James Patterson
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 25 Jan 2003 19:36:47
Message: <3e332d9f@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3e331921@news.povray.org...
>   The HF_Sphere() macro in shapes.inc has been designed for this purpose.
> See the documentation about standard include files and shapes.inc.

I found that, but am not sure how to use it with my grayscale topographic
map of the earths surface.  The documentation says that the macro does not
use a height field image directly for input and does not tell me how to use
one indirectly.  I can create a planar height field using pov's height field
object and my topographic map just fine.  What am I missing?


Post a reply to this message

From: Christoph Hormann
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 26 Jan 2003 03:36:47
Message: <3E339E1F.2AE8F2D9@gmx.de>
James Patterson wrote:
> 
> >   The HF_Sphere() macro in shapes.inc has been designed for this purpose.
> > See the documentation about standard include files and shapes.inc.
> 
> I found that, but am not sure how to use it with my grayscale topographic
> map of the earths surface.  The documentation says that the macro does not
> use a height field image directly for input and does not tell me how to use
> one indirectly.  I can create a planar height field using pov's height field
> object and my topographic map just fine.  What am I missing?

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.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 31 Dec. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Tim Nikias
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 26 Jan 2003 05:17:32
Message: <3e33b5bc@news.povray.org>
> I have been able to locate one showing the elevations above sea level but
> one including the portion under the oceans would be great, then I could have
> my students experiment with modeling changes in ocean levels as well.

Can't comply. Only got the "above sealevel" version as well. :-(


> Your telling me!  Currently, I am simply trying to simulate cloud formation
> and motions due to the coriolis force and global insolation (the amount of
> sun light striking the earth at any given time.)  The clouds start out as
> simple textures applied to various spheres representing different levels of
> the earths atmosphere.  I believe I have a relatively accurate
> representation of cloud motion, however, at the tropics I have way to many
> clouds.  Eventually, I would like to have some interaction between the
> atmosphere and the ocean as well as the land once I get this Height field
> issue figured out. I would like my students to aim for a realistic as
> possible simulation which is why I'm trying to do this on my own first so I
> can help them through the tough parts.  Keep in mind I am trying to do all
> of this from within POV-Ray which may be an unrealistic goal on my part.

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! :-)

Regards,
Tim

PS: If you need help for your code, you know that the newsgroups are the
best POV has to offer online!

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde


Post a reply to this message

From: hughes, b 
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 26 Jan 2003 06:34:40
Message: <3e33c7d0@news.povray.org>
"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3E339E1F.2AE8F2D9@gmx.de...
>
> James Patterson wrote:
> >
> > >   The HF_Sphere() macro in shapes.inc has been designed for this
purpose.
> > > See the documentation about standard include files and shapes.inc.
>
> 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.

Should, I guess... doesn't.

I was just trying this out, having seen this thread about HF_Sphere macro,
and I get an error at the first array line in HF_Create, PArr [J][K], says:
vector expected but color expression found.

Nothing I try seems to solve the problem. I set it up in a scene file as
follows:

#declare Function=function {
 pigment {
  image_map {
   png "c:\images\test.png"
  }
 }
}

#declare UseUVheight=1;
#declare UseUVtexture=1;
#declare Res=<10,10>;
#declare Smooth=1;
#declare FileName=""
#declare Center=<0,0,0>;
#declare Radius=1;
#declare Depth=0.1;

#include "shapes.inc"

HF_Sphere
(Function,UseUVheight,UseUVtexture,Res,Smooth,FileName,Center,Radius,Depth)

Going by the Doc on this, I suppose I'm doing everything right.


Post a reply to this message

From: Christoph Hormann
Subject: Re: Wrapping A Hieght Field Object Around an elipsoid object
Date: 26 Jan 2003 06:48:45
Message: <3E33CB1C.1ADD13F5@gmx.de>
"hughes, b." wrote:
> 
> [...]
> 
> Should, I guess... doesn't.
> 
> I was just trying this out, having seen this thread about HF_Sphere macro,
> and I get an error at the first array line in HF_Create, PArr [J][K], says:
> vector expected but color expression found.

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
)

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 31 Dec. 2002 _____./\/^>_*_<^\/\.______


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: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

Goto Latest 10 Messages Next 6 Messages >>>

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