POV-Ray : Newsgroups : povray.animations : elliptic orbit and camera orientation : elliptic orbit and camera orientation Server Time
19 Apr 2024 11:14:18 EDT (-0400)
  elliptic orbit and camera orientation  
From: rodv92
Date: 3 Mar 2013 16:20:01
Message: <web.5133bdc71e212b6a98a44ff0@news.povray.org>
Hello everybody !

i have some trouble making an animation of a satellite orbiting a planet.
the camera uses the point of view of the satellite.

the direction of view is following the orbit path (tangential to orbit and
prograde)
the orientation is such that the "up" is a vector that originates from the
origin, and the "right" is the normal to the tangential and the up vector.

So at everytime the planet should be "below" in the images.

It is not the case, and it must be a dumb error...

any help appreciated.

Here is the SDL :

// ORBIT
#declare orbit = <10,0,0>; //major radius
#declare orbit = vrotate(orbit,<0,-3*clock,0>); // rotate about origin
#declare orbit = orbit*<1,1,0.3>; // scale z for minor radius
#declare orbit = vrotate(orbit,<-60,0,0>); // tilt orbit up
#declare orbit = vrotate(orbit,<0,30,0>); // twist orbit a bit

// 2nd point to calculate the approximate TANGENTIAL
#declare orbit2 = <10,0,0>; //major radius
#declare orbit2 = vrotate(orbit2,<0,-3*(clock+1),0>); // rotate about origin
#declare orbit2 = orbit2*<1,1,0.3>; // scale z for minor radius
#declare orbit2 = vrotate(orbit2,<-60,0,0>); // tilt orbit up
#declare orbit2 = vrotate(orbit2,<0,30,0>); // twist orbit a bit


#declare prograde = orbit2 - orbit; // TANGENTIAL VECTOR
#declare pro_right = vcross(orbit,prograde); // RIGHT VECTOR

camera {

  location orbit
  look_at orbit2
  right vnormalize(pro_right)*4/3  // normal to the plane of the orbit
  up vnormalize(orbit) // normal to the tangential in the plane of the orbit
  angle 50
}


light_source {
  <0,20,-50>*10             // light's position (translated below)
  color <1,1,1>     // light's color
  adaptive 0          // 0,1,2,3...
  jitter              // adds random softening of light

}

sphere { <0,0,0>,2.8
texture { pigment { color Blue }  }


Post a reply to this message

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