POV-Ray : Newsgroups : povray.binaries.images : A geographical question (in a broad sense) : Re: A geographical question (in a broad sense) Server Time
5 Nov 2024 13:25:10 EST (-0500)
  Re: A geographical question (in a broad sense)  
From: Lukas Winter
Date: 13 Apr 2009 04:18:17
Message: <49e2f549$1@news.povray.org>
Am Mon, 13 Apr 2009 01:58:47 +0200 schrieb Jörg 'Yadgar' Bleimann:
> 
> Which tutorial? I'm not sure whether you mean the official POV-Ray
> tutorial coming with the Windows version...
> 
I was referring to this astronomy turotial.

>  > So, how do you for example place the sun? Do you do something like...
>  > object
>  > {
>  >   sun
>  >   translate z*suns_distance_from_earth
>  >   rotate x*suns_latitude_viewed_from_earth rotate
>  >   y*suns_longitude_viewd_from_eart
>  > } ?
> 
> No, of course not... I use a heliocentric system with the Sun sitting at
> the origin! But this doesn't tell me yet how to convert Earth surface
> geographic coordinates to cartesian coordinates...

Phew :)
Well, these are basically spherical coordinates, so you can use
position = <cos latitude * sin longitude, sin latitude, -sin latitude * 
sin longitude> * r
With r being the radius of the earth and longitude and latitude being the 
geographical coordinates of the point to look at. It should be enough to 
approximate the shape of the earth as a sphere.
Now position is in a local point space with the centre of earth being 
located at the origin and the geographical poles being located at <0, r, 
0> and <0, -r, 0>. Now you can use POV's built-in vector functions to 
tilt this point and translate it.


Post a reply to this message

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