POV-Ray : Newsgroups : povray.binaries.images : Tilted orbit problem Server Time
11 May 2024 09:35:30 EDT (-0400)
  Tilted orbit problem (Message 1 to 7 of 7)  
From: Jörg 'Yadgar' Bleimann
Subject: Tilted orbit problem
Date: 3 Dec 2009 14:41:16
Message: <4b18145c@news.povray.org>
High!

After Reactor led me out of the "media trap" while trying to get 
believable Saturnian rings, the next problem occurred: I'm just not able 
to make a moon (in this test it's Pan, the innermost one running in the 
Encke ring gap at about 135,000 kms from the planet's center) orbiting 
exactly in Saturn's equatorial plane!

Saturn is tilted using my "SetAxis" macro according to the equatorial 
coordinates of its axis (gleaned from Wikipedia):

#macro SetAxis(dec, ras)
   rotate <23.439281-(90-dec), 0, 0>
   rotate <0, 90-ras, 0>
#end

which is invoked with the parameters 83.537 (declination) and 40.589 
(right ascension, in degrees).

After I programmed a small test scene (code attached below) to probe 
different inclinations and ascending node angles for orbits, I assumed 
the transformation of these two values into my solar system model to be:

#declare Pos_Pan = Pos_Saturn + 
bodies[2][0]*<cos(radians(23.439281-(90-bodies[1][10])))*sin(radians(clock)), 
sin(radians(23.439281-(90-bodies[1][10])))*sin(radians(clock-(90+bodies[1][11]))),
cos(radians(23.439281-(90-bodies[1][10])))*cos(radians(clock))>;

...but it didn't work - as you can see in the five images attached (Pan 
colored red and heavily exaggerated in size for better visibility, at 

orbit doesn't match Saturn's equatorial, i. e. ring plane!

Regardless what combinations of signs and angle values I tried, I never 
got Pan orbiting in the ring plane...

Here is the small test scene:

// beginning of code

light_source
{
   <-5000, 0, 0>
   color rgb 1
}

#declare moon_dist = 5;
#declare moon_incl = 45;
#declare asc_node = 60;

sphere // planet
{
   0, 1
   pigment { rgb <1, 0, 0> }
}

sphere // moon
{
   0, 1
   pigment { rgb <1, 1, 0> }
   scale 0.2
   translate moon_dist*<cos(radians(moon_incl))*sin(radians(clock)), 
sin(radians(moon_incl))*sin(radians(clock-asc_node)), 
cos(radians(moon_incl))*cos(radians(clock))>
}

camera
{
   orthographic
   location <-20, 0, 0>
   look_at 0
   angle 50
}

// end of code

...and here the Saturn scene:

// beginning of code

// INCLUDES

#include "functions.inc"

// VARIABLES

#declare sc=13347; // 13347; // 1 POV unit = 13347 kilometres

global_settings
{
   max_trace_level 20
   assumed_gamma 1.5
}

// FINISHES

#declare F_Standard_Planetary_Surface =
finish
{
   ambient 0.0001
   diffuse 1
   brilliance 0.8
}

#declare F_Saturn_Rings =
finish
{
   ambient 0.0001
   diffuse 1
   brilliance 0.05
}

#declare bodies = array [3][12]
{
   {           0,     696000,       -1,      -1,	     7.25,     0, 
  0,             0,         0,       0.000009,  63.87,   286.125   }, 
//   0 - Sun
   {  1433449370,      60268,    54364,   60268,  26.73,        2.484, 
  0.055723219, 336.013862,113.642811,-1,       83.537,   40.589    } // 
  1 - Saturn
   {      133584,         17.5,     17.5,    11.5,    0,        0.0001, 
  0.0000144,    -1,        -1,      -1,         -1,       -1       } // 
2 - Pan (Saturn XVIII)
}


#declare Pos_Saturn = bodies[1][0]*<sin(radians(157.4)), 0, 
cos(radians(157.4))>;
#declare Pos_Pan = Pos_Saturn + 
bodies[2][0]*<cos(radians(23.439281-(90-bodies[1][10])))*sin(radians(clock)), 
sin(radians(23.439281-(90-bodies[1][10])))*sin(radians(clock-(90+bodies[1][11]))),
cos(radians(23.439281-(90-bodies[1][10])))*cos(radians(clock))>;


#declare cam = 0; // camera mode

#switch (cam)
   #case (0) // centered on Saturn, view of lit ring ride
     #declare camPos = Pos_Saturn + 500000 * <sin(radians(64)), 0, 
cos(radians(64))>;
     #declare camLook = Pos_Saturn;
     #declare camAng = 40;
   #break
   #case (1) // centered on Saturn, view of unlit ring side
     #declare camPos = Pos_Saturn + 500000 * <sin(radians(244)), 0, 
cos(radians(244))>;
     #declare camLook = Pos_Saturn;
     #declare camAng = 40;
   #break

#end


#macro SetAxis(dec, ras)
   rotate <23.439281-(90-dec), 0, 0>
   rotate <0, 90-ras, 0>
#end

light_source // Sun
{
   0
   color rgb 1
   looks_like
   {
     sphere
     {
       0, 1
       texture
       {
        pigment { color rgb <1, 1, 0.85> }
        finish { ambient 1 diffuse 0 }
       }
       scale bodies[0][1]/sc
       SetAxis(bodies[0][10], bodies[0][11])
     }
   }
}

#declare Saturn_Rings_Colors =
pigment
{
   image_map
   {
     png "solarsys/sat_ring_color_bjoernjonsson.png"
   }
}

#declare Saturn_Rings_Transparency =
pigment
{
   image_map
   {
     png "solarsys/transparency_bjoernjonsson.png"
   }
}


union
{
sphere // Saturn
{
   0, 1
   texture
   {
     pigment
     {
       image_map
       {
         jpeg "solarsys/saturn_bjoernjonsson.jpg"
         map_type 1
         interpolate 2
       }
     }
     finish { F_Standard_Planetary_Surface }
   }
   scale <bodies[1][1], bodies[1][2], bodies[1][3]>/sc
}


difference // rings
{
   cylinder
   {
     <0, -0.011, 0>/sc, <0, 0.01, 0>/sc, 140390/sc
   }
   cylinder
   {
     <0, -0.012, 0>/sc, <0, 0.011, 0>/sc, 74510/sc
   }
     double_illuminate
     texture
     {
       pigment
       {
         cylindrical
         color_map // preliminary low-res version
         {
           #declare a=0;
           #while (a<255)
             #declare c=eval_pigment(Saturn_Rings_Colors, 
<509/510-a/255, 0.5, 0>);
             #declare f=eval_pigment(Saturn_Rings_Transparency, 
<509/510-a/255, 0.5, 0>);
             [a*(((140390-74510)/140390)/255) rgb c filter f.gray ]
             #declare a=a+1;
            #end
          }
          scale 140390/sc
       }
       finish { F_Saturn_Rings }
     }
   }
   SetAxis(bodies[1][10], bodies[1][11])
   translate Pos_Saturn/sc
}

sphere
{
   0, 1
   texture
   {
     pigment { color rgb <1, 0, 0> }
     finish { F_Standard_Planetary_Surface }
   }
   scale <bodies[2][1], bodies[2][2], bodies[2][3]>/sc*300
   translate Pos_Pan/sc
}

camera
{
   location camPos/sc
   look_at camLook/sc
   angle camAng
}

// end of code

I really wonder whether I'm in fact intellectually handicapped - most of 
you, I assume, throw out such scenes even when half asleep, and they are 
flawless! Could it be in fact better for me (and this group) to give up 
POV-Ray entirely and turn to something more appropriate for my moronic 
little brain, such as munching donuts or collecting die-cast model cars...?


Post a reply to this message


Attachments:
Download '2009-12-03 pan test, take 1.jpg' (21 KB) Download '2009-12-03 pan test, take 2.jpg' (22 KB) Download '2009-12-03 pan test, take 3.jpg' (21 KB) Download '2009-12-03 pan test, take 4.jpg' (21 KB) Download '2009-12-03 pan test, take 5.jpg' (21 KB)

Preview of image '2009-12-03 pan test, take 1.jpg'
2009-12-03 pan test, take 1.jpg

Preview of image '2009-12-03 pan test, take 2.jpg'
2009-12-03 pan test, take 2.jpg

Preview of image '2009-12-03 pan test, take 3.jpg'
2009-12-03 pan test, take 3.jpg

Preview of image '2009-12-03 pan test, take 4.jpg'
2009-12-03 pan test, take 4.jpg

Preview of image '2009-12-03 pan test, take 5.jpg'
2009-12-03 pan test, take 5.jpg


 

From: Thomas de Groot
Subject: Re: Tilted orbit problem
Date: 4 Dec 2009 03:15:23
Message: <4b18c51b$1@news.povray.org>
I have not looked at your code, but isn't it true that the *whole* saturnian 
system is tilted? I am almost sure the problem comes from the order in which 
you do the transformations. What I mean is that when applying the tilt, this 
should be done to a union of Saturn + rings + satellite. So, you have first 
to make your satellite orbit around  the planet without the tilt (and at the 
origin), and only at the end tilt the complete saturnian system (and 
translate it where it has to go). That way you are sure the satellite 
remains in its correct orbit.

Thomas


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Tilted orbit problem
Date: 4 Dec 2009 08:30:49
Message: <4b190f09$1@news.povray.org>
Thomas de Groot wrote:
> I have not looked at your code, but isn't it true that the *whole* saturnian 
> system is tilted? I am almost sure the problem comes from the order in which 
> you do the transformations. What I mean is that when applying the tilt, this 
> should be done to a union of Saturn + rings + satellite. So, you have first 
> to make your satellite orbit around  the planet without the tilt (and at the 
> origin), and only at the end tilt the complete saturnian system (and 
> translate it where it has to go). That way you are sure the satellite 
> remains in its correct orbit.

Principally, you're right... but then, almost all moons' orbits are also 
more or less tilted against Saturn's equatorial plane, and although 
Wikipedia gives no data about the ascending nodes of these orbits, it's 

would be easiest to calculate). So also with the union method, I would 
sooner or later (when refining my Solar System gradually) face the same 
problem - but then at least one step less to calculate!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Rarius
Subject: Re: Tilted orbit problem
Date: 4 Dec 2009 11:39:28
Message: <4b193b40$1@news.povray.org>

> Thomas de Groot wrote:
>> I have not looked at your code, but isn't it true that the *whole* 
>> saturnian system is tilted? I am almost sure the problem comes from 
>> the order in which you do the transformations. What I mean is that 
>> when applying the tilt, this should be done to a union of Saturn + 
>> rings + satellite. So, you have first to make your satellite orbit 
>> around  the planet without the tilt (and at the origin), and only at 
>> the end tilt the complete saturnian system (and translate it where it 
>> has to go). That way you are sure the satellite remains in its correct 
>> orbit.
> 
> Principally, you're right... but then, almost all moons' orbits are also 
> more or less tilted against Saturn's equatorial plane, and although 
> Wikipedia gives no data about the ascending nodes of these orbits, it's 

> would be easiest to calculate). So also with the union method, I would 
> sooner or later (when refining my Solar System gradually) face the same 
> problem - but then at least one step less to calculate!
> 
> See you in Khyberspace!
> 
> Yadgar

You are quite right... Some of the Saturnian moons are quiet a way out 
of the ring plane. Iapetus for example is over 14deg out!

I am surprised that you seem to be using trig functions to calculate the 
positions... I would have thought that judicious use of the vRotate() 
function would be much clearer and possibly quicker.

I did find the following, but again it seems to be missing the angle of 
the ascending node for the moons! 
http://nssdc.gsfc.nasa.gov/planetary/factsheet/saturniansatfact.html

Rarius


Post a reply to this message

From: Alain
Subject: Re: Tilted orbit problem
Date: 4 Dec 2009 13:52:45
Message: <4b195a7d$1@news.povray.org>

> High!
> 
> After Reactor led me out of the "media trap" while trying to get 
> believable Saturnian rings, the next problem occurred: I'm just not able 
> to make a moon (in this test it's Pan, the innermost one running in the 
> Encke ring gap at about 135,000 kms from the planet's center) orbiting 
> exactly in Saturn's equatorial plane!
> 
> Saturn is tilted using my "SetAxis" macro according to the equatorial 
> coordinates of its axis (gleaned from Wikipedia):
>

Keep it simple.

First, create Saturn with NO tilting.
Then, place the rings. Still no tilt.
After that, place the various satellites only taling the relative 
tilting of ther orbits into acount. Tilt of zero for equatorial orbits, 
90 for a polar one.

Finaly, wrap everything on a single union, planet, rings and all moons. 
Apply the planetary tilting to the whole union at once.



Alain


Post a reply to this message

From: Alain
Subject: Re: Tilted orbit problem
Date: 4 Dec 2009 13:58:06
Message: <4b195bbe$1@news.povray.org>

> Thomas de Groot wrote:
>> I have not looked at your code, but isn't it true that the *whole* 
>> saturnian system is tilted? I am almost sure the problem comes from 
>> the order in which you do the transformations. What I mean is that 
>> when applying the tilt, this should be done to a union of Saturn + 
>> rings + satellite. So, you have first to make your satellite orbit 
>> around  the planet without the tilt (and at the origin), and only at 
>> the end tilt the complete saturnian system (and translate it where it 
>> has to go). That way you are sure the satellite remains in its correct 
>> orbit.
> 
> Principally, you're right... but then, almost all moons' orbits are also 
> more or less tilted against Saturn's equatorial plane, and although 
> Wikipedia gives no data about the ascending nodes of these orbits, it's 

> would be easiest to calculate). So also with the union method, I would 
> sooner or later (when refining my Solar System gradually) face the same 
> problem - but then at least one step less to calculate!
> 
> See you in Khyberspace!
> 
> Yadgar

With Saturn sitting at the origin:
Use a 'Y' rotation to move the moon about it's orbit.
Use a 'X' rotation for the tilt plus a 'Y' rotation to shift the nodes.

Then, translate Saturn to it's orbit, and rotate it around to make it 
travel along it.


Alain


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Tilted orbit problem
Date: 4 Dec 2009 14:47:51
Message: <4b196767@news.povray.org>
High!

Alain wrote:

> With Saturn sitting at the origin:
> Use a 'Y' rotation to move the moon about it's orbit.
> Use a 'X' rotation for the tilt plus a 'Y' rotation to shift the nodes.

The exact formula for the tilt relative to Saturn's equatorial plane 
would be vrotate(Pos_Pan, <bodies[73][5], bodies[73][8]-90, 0> - as no Y 


After that, the whole union is rotated relative to the ecliptic to match 
the orientation of Saturn's axis...

See you in Khyberspace!

Yadgar


Post a reply to this message

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