|
|
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
|
|
|
|
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.
Post a reply to this message
|
|
|
|
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
> 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.
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
Post a reply to this message
|
|