|
|
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
|
|