POV-Ray : Newsgroups : povray.general : how to use the SKY vector for CAMERA? : Re: how to use the SKY vector for CAMERA? Server Time
12 Aug 2024 07:22:47 EDT (-0400)
  Re: how to use the SKY vector for CAMERA?  
From: Nathan Kopp
Date: 17 Mar 1999 16:11:39
Message: <36F01A3B.B74614EA@Kopp.com>
I really don't think rotate will roll the camera... it just moves its
position.

I don't know what the documentation says, but sky points towards the sky
(perpendicular to the horizon).  So if your camera is looking towards
+x, and the sky is usually +y, then if you change it to +z, you'll roll
the camera by 90 degrees.  If you use, for example, <0,1,1>, you'll
roll the camera 45 degrees.

here's a script that is interesting

#declare cam_dir = cam_lookat - cam_location;
#declare cam_right = vcross(cam_dir, old_cam_up);
  // old_cam_up would be y (unless you changed it)
  // cam_right is a vector that is perpendicular to both the direction
  //  that the camera is pointing and to the up vector
#declare cam_up_perp = vcross( cam_right, cam_dir);
  // cam_up_perp is an up vector that you could use to give the same
  //  results as 'y', but it is now perpendicular to the camera's
  //  direction

/*
Now, you can rotate cam_up_perp around cam_right (using
vrotate_axis(), IIRC) and use that as your new UP vector.

This code has not been tested... I just whipped it up now.  I hope
it helps.

Side view of what we this did:

  y  / cam_up_perp
  | /
  |/
  *--__  <-- cam_dir
       --__
           --#

* camera position
# camera look_at

*/

Nieminen Mika wrote:
> 
> bruce mackay <bma### [at] hevanetcom> wrote:
> : Can anyone explain the use of the sky vector for the camera better
> : than the documentation?  It is a little a little vague and brief .  It would
> : be great to be able to roll the camera in a predictable way.
> 
>   Why don't you just use the 'rotate' keyword?
> 
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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