POV-Ray : Newsgroups : povray.animations : elliptic orbit and camera orientation : Re: elliptic orbit and camera orientation Server Time
25 Apr 2024 07:46:37 EDT (-0400)
  Re: elliptic orbit and camera orientation  
From: John VanSickle
Date: 28 Mar 2013 00:10:26
Message: <5153c2b2$1@news.povray.org>
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

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