POV-Ray : Newsgroups : povray.general : camera "angle" : Re: camera "angle" Server Time
26 Apr 2024 18:35:08 EDT (-0400)
  Re: camera "angle"  
From: Bald Eagle
Date: 9 Apr 2018 19:25:00
Message: <web.5acbf5699fefb05a5cafe28e0@news.povray.org>
dick balaska <dic### [at] buckosoftcom> wrote:

> Thanks.  I assume CamR is camera->right, but how is that
> different/related to Camera_Aspect_Ratio?  I thought aspect ratio *is*
> the right vector.

I was using screen.inc in that scene, and so those are the variables straight
out of the Update_Camera() macro.
AFAIK, "right" is technically the direction to the right, which would usually be
the unit vector x, or <1, 0, 0>.  But I think most of us use the
image_width/image_height ratio to automatically correct for the aspect ratio of
the usual displays...

.... or I'm completely wrong   ;)

#macro Update_Camera()

   #ifndef (Camera_Aspect_Ratio)
      #declare Camera_Aspect_Ratio = image_width/image_height;
   #end
   #ifndef (Camera_Location) #declare Camera_Location = <0,0,0>; #end
   #ifndef (Camera_Look_At)  #declare Camera_Look_At = z;        #end
   #ifndef (Camera_Sky)      #declare Camera_Sky = y;            #end
   #ifndef (Camera_Zoom)     #declare Camera_Zoom = 1;           #end


   #declare CamL=Camera_Location;                     // wherever you're putting
it
   #declare CamD=vnormalize(Camera_Look_At-CamL);     // direction of camera
view
   #declare CamR=vnormalize(vcross(Camera_Sky,CamD)); // to the right
   #declare CamU=vnormalize(vcross(CamD,CamR));       // camera up
   #declare Camera_Transform =
   transform {
      matrix <
         CamR.x, CamR.y, CamR.z,
         CamU.x, CamU.y, CamU.z,
         CamD.x, CamD.y, CamD.z,
         CamL.x, CamL.y, CamL.z
      >
   }

   camera {
     direction CamD*Camera_Zoom
     right CamR*Camera_Aspect_Ratio
     up CamU
     sky Camera_Sky
     location CamL
   }

#end


Post a reply to this message

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