POV-Ray : Newsgroups : povray.binaries.images : A geographical question (in a broad sense) Server Time
14 Nov 2024 14:18:09 EST (-0500)
  A geographical question (in a broad sense) (Message 1 to 7 of 7)  
From: Jörg 'Yadgar' Bleimann
Subject: A geographical question (in a broad sense)
Date: 12 Apr 2009 10:11:52
Message: <49e1f6a8$1@news.povray.org>
High!

While waiting for help with the rail segments connection problem, I 
reactivated a very old project put to hibernation back in 1999: a 
full-fledged POV Solar System, this time with astronomically correct 
elliptical orbits of planets and moons and a procedural starry 
sky_sphere gleaned from star data from a German astronomical atlas 
("Karkoschka"), as I found a promising tutorial on computing planetary 
positions on the website of a Swedish amateur astronomer
( http://www.stjarnhimlen.se/comp/tutorial.html )

I programmed several camera modes, one of them with the camera pointing 
towards a customizable location stated in geographical coordinates on 
Earth. As long I left my Earth sphere standing upright in space, this 
works fine - but how do I correct the camera's orientation for Earth's 
axial tilt (rotate <23.4333, 0, 0>?

I quickly understood that the tilt angle multiplied with the sine of the 
  longitude (with western longitudes being positive, eastern ones 
negative) had to be added to/subtracted from the original latitude - but 
how is the longitude adjusted afterwards?

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Lukas Winter
Subject: Re: A geographical question (in a broad sense)
Date: 12 Apr 2009 11:58:13
Message: <49e20f95$1@news.povray.org>
Am Sun, 12 Apr 2009 16:12:33 +0200 schrieb Jörg 'Yadgar' Bleimann:
> 
> I programmed several camera modes, one of them with the camera pointing
> towards a customizable location stated in geographical coordinates on
> Earth. As long I left my Earth sphere standing upright in space, this
> works fine - but how do I correct the camera's orientation for Earth's
> axial tilt (rotate <23.4333, 0, 0>?
> 
> I quickly understood that the tilt angle multiplied with the sine of the
>   longitude (with western longitudes being positive, eastern ones
> negative) had to be added to/subtracted from the original latitude - but
> how is the longitude adjusted afterwards?
> 

Why not do these calculations in cartesian coordinate space? I suppose 
you already have a way of converting a point from earth's local 
geographical coordinate system to earth's local cartesian coordinate 
system. All you have to do with the resulting vector is to rotate it 
around earths axis of tilt using vrotate(). Then translate and rotate it 
according to earth's position in the solar system and you should arrive 
at the point's world coordinates.


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: A geographical question (in a broad sense)
Date: 12 Apr 2009 13:05:09
Message: <49e21f45$1@news.povray.org>
High!

Lukas Winter schrieb:

 > Why not do these calculations in cartesian coordinate space? I 
suppose you already have a way of converting a point from earth's local 
geographical coordinate system to earth's local cartesian coordinate 
system.

No, I do not yet... how could I do this?

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Lukas Winter
Subject: Re: A geographical question (in a broad sense)
Date: 12 Apr 2009 16:51:50
Message: <49e25466$1@news.povray.org>
Am Sun, 12 Apr 2009 19:05:55 +0200 schrieb Jörg 'Yadgar' Bleimann:

> High!
> 
> Lukas Winter schrieb:
> 
>  > Why not do these calculations in cartesian coordinate space? I
> suppose you already have a way of converting a point from earth's local
> geographical coordinate system to earth's local cartesian coordinate
> system.
> 
> No, I do not yet... how could I do this?
> 
> See you in Khyberspace!
> 
> Yadgar

So... wait, you have a "full-fledged POV solar system" and no way of 
converting coordinates? How can you place _any_ object if you do not have 
cartesian coordinates which POV uses everywhere?
Take a look at chapter 3 of the tutorial, there the author describes how 
to convert geometric and cartesian coordinates.
The author of this tutorial calculates everything in respect of an 
observer on the surface of the earth which I think is the traditional 
astronomic approach but could pose some difficulties in POV. If you have 
already followed this tutorial all along then it would be nonsense to 
abandon this way of calculation.
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
} ?
I think the tutorial suggests doing that but it makes everything 
extremely complicated. No wonder the geocentric model is no longer used...
Sorry, I can't come up with an answer to your original question without 
knowing how you set up your coordinate system.


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: A geographical question (in a broad sense)
Date: 12 Apr 2009 19:57:59
Message: <49e28007$1@news.povray.org>
High!

Lukas Winter schrieb:

 > So... wait, you have a "full-fledged POV solar system" and no way of 
converting coordinates? How can you place _any_ object if you do not 
have cartesian coordinates which POV uses everywhere?
 > Take a look at chapter 3 of the tutorial, there the author describes 
how to convert geometric and cartesian coordinates.

Which tutorial? I'm not sure whether you mean the official POV-Ray 
tutorial coming with the Windows version...

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

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Alain
Subject: Re: A geographical question (in a broad sense)
Date: 12 Apr 2009 21:14:48
Message: <49e29208$1@news.povray.org>
Jörg 'Yadgar' Bleimann nous illumina en ce 2009-04-12 10:12 -->
> High!
> 
> While waiting for help with the rail segments connection problem, I 
> reactivated a very old project put to hibernation back in 1999: a 
> full-fledged POV Solar System, this time with astronomically correct 
> elliptical orbits of planets and moons and a procedural starry 
> sky_sphere gleaned from star data from a German astronomical atlas 
> ("Karkoschka"), as I found a promising tutorial on computing planetary 
> positions on the website of a Swedish amateur astronomer
> ( http://www.stjarnhimlen.se/comp/tutorial.html )
> 
> I programmed several camera modes, one of them with the camera pointing 
> towards a customizable location stated in geographical coordinates on 
> Earth. As long I left my Earth sphere standing upright in space, this 
> works fine - but how do I correct the camera's orientation for Earth's 
> axial tilt (rotate <23.4333, 0, 0>?
> 
> I quickly understood that the tilt angle multiplied with the sine of the 
>  longitude (with western longitudes being positive, eastern ones 
> negative) had to be added to/subtracted from the original latitude - but 
> how is the longitude adjusted afterwards?
> 
> See you in Khyberspace!
> 
> Yadgar
If you start ON the ecliptic, or Earth's orbital plane, at a point based on the 
Earth's position at the time of an equinox, you don't have to compensate. In 
this case, the rotation is only around a single axis.

Another aproach:
Don't tilt the earth, DO tilt everything else! The end visual result will be 
exactly the same.

As the camera is selected with a variable, you can use that same variable to 
tilt, or not, your "universe".

-- 
Alain
-------------------------------------------------
I couldn't repair your brakes, so I made your horn louder.


Post a reply to this message

From: Lukas Winter
Subject: Re: A geographical question (in a broad sense)
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.