POV-Ray : Newsgroups : povray.animations : elliptic orbit and camera orientation Server Time22 Jul 2024 12:52:17 EDT (-0400)
 elliptic orbit and camera orientation (Message 1 to 4 of 4)
 From: rodv92 Subject: elliptic orbit and camera orientation Date: 3 Mar 2013 16:20:01 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.5133bdc71e212b6a98a44ff0%40news.povray.org",
"headline": "elliptic orbit and camera orientation",
"dateCreated": "2013-03-03T21:20:01+00:00",
"datePublished": "2013-03-03T21:20:01+00:00",
"author": {
"@type": "Person",
"name": "rodv92"
}
}
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
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
jitter              // adds random softening of light

}

sphere { <0,0,0>,2.8
texture { pigment { color Blue }  }
```
 From: Christian Froeschlin Subject: Re: elliptic orbit and camera orientation Date: 4 Mar 2013 06:50:24 Message: <51348a80\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#51348a80%241%40news.povray.org",
"headline": "Re: elliptic orbit and camera orientation",
"dateCreated": "2013-03-04T11:50:24+00:00",
"datePublished": "2013-03-04T11:50:24+00:00",
"author": {
"@type": "Person",
"name": "Christian Froeschlin"
}
}
rodv92 wrote:

> So at everytime the planet should be "below" in the images.
>
> It is not the case, and it must be a dumb error...

Are you sure that clock + 1 is what you want for the
numerical approximation? Default clock is from 0 to 1
so that step width is your entire animation movement.

Also, note that your orbital mechanics approximation is
seriously inaccurate for such a highly elliptical orbit. The
planet should be in one of the elliptical focal points, and
according to keplers 2nd law the satellite will move a lot
faster when near the planet.
```
 From: rodv92 Subject: Re: elliptic orbit and camera orientation Date: 6 Mar 2013 01:35:08 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.5136e137e2a696655d50475e0%40news.povray.org",
"headline": "Re: elliptic orbit and camera orientation",
"dateCreated": "2013-03-06T06:35:08+00:00",
"datePublished": "2013-03-06T06:35:08+00:00",
"author": {
"@type": "Person",
"name": "rodv92"
}
}
Christian Froeschlin <chr### [at] chrfrde> wrote:
> rodv92 wrote:
>
> > So at every-time the planet should be "below" in the images.
> >
> > It is not the case, and it must be a dumb error...
>
> Are you sure that clock + 1 is what you want for the
> numerical approximation? Default clock is from 0 to 1
> so that step width is your entire animation movement.
>
> Also, note that your orbital mechanics approximation is
> seriously inaccurate for such a highly elliptical orbit. The
> planet should be in one of the elliptical focal points, and
> according to keplers 2nd law the satellite will move a lot
> faster when near the planet.

Hi, First to say that i use initial_frame = 1 and final_frame = 100 and same
thing for clock, that will output in a 25fps animation.

For the orbital mechanics i am well aware that they're not OK, basically i have
not done any work yet, but i will as soon as i correct the orbital geometry
characteristics.

i know too that as far as the geometry goes, the geometry is dependent on the
gravity configuration / placement of the celestial bodies, but once again i plan
to correct this later.

I am only trying to make the camera view OK for the moment.

Best regards. and have all a nice day.
```
 From: John VanSickle Subject: Re: elliptic orbit and camera orientation Date: 28 Mar 2013 00:10:26 Message: <5153c2b2\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#5153c2b2%241%40news.povray.org",
"headline": "Re: elliptic orbit and camera orientation",
"dateCreated": "2013-03-28T04:10:26+00:00",
"datePublished": "2013-03-28T04:10:26+00:00",
"author": {
"@type": "Person",
"name": "John VanSickle"
}
}
On 3/3/2013 3:16 PM, rodv92 wrote:
> 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
> 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.

The look_at method of aiming the camera works best when the up direction
for the scene is going to be more or less consistent.  If the concept of
'up' is going to change significantly during the scene, then you should
probably calculate the necessary vectors and given them to the camera.

Now I'm going to assume that you already have the tangent in the vector
vTangent, the camera location in pCamera, the planet location in
pPlanet, and the zoom value for the camera in sZoom.

Having these values, you set up the camera this way:

#local vDir = vnormalize(vTangent);
#local vRight = vnormalize(vcross(vTangent, pCamera - pPlanet));
#local vUp = vnormalize(vcross(vRight, vDir)); // right-handed scene

camera {
location pCamera
up vUp
direction vDir * sZoom
right vRight * image_width/image_height
}

Hope this helps,
John
```