POV-Ray : Newsgroups : povray.binaries.images : Tilted orbit problem : Tilted orbit problem Server Time
4 Nov 2024 19:23:11 EST (-0500)
  Tilted orbit problem  
From: Jörg 'Yadgar' Bleimann
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


 

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