|
|
Op 17/11/2020 om 22:12 schreef Bald Eagle:
> Thomas de Groot <tho### [at] degrootorg> wrote:
>> The macro works perfectly... as long as your scene camera is situated
>> about the origin of the Y-axis.
>
> For the moment, just disregard my other suggestions/guesses.
>
> Just get rid of the VCorr term in the matrix.
> I have no idea what that's for, but it seems to be the source of the problem.
>
> Do a few fast, simple [but extreme] renders and see what you think.
>
>
#declare NoFall =
transform {
matrix < 1, 0, 0,
ShearX, 1, ShearZ,
0, 0, 1,
0, 0, 0>
}
Better (the camera stays at the correct altitude) but is still shifted
increasingly in the view direction. At least, it shows that, as
suspected, VCorr did not serve any purpose. Interestingly, in its first
version, John did not have a VCorr at all!
Using a cube as a proxy camera, shifted an arbitrary value in front of
the camera to make it visible, I can show what happens. The red,
transparant, box is the proxy of the "real" camera; the yellow box is
the proxy of the "real" camera, shifted along the line of view after the
application of the NoFall transform. The distance between the cubes
increases with the height of the camera for y>0.
From this, it is easy to write a quick-and-dirty correction to be added
/after/ the NoFall transform in the camera definition:
//start code
FieldCam (CamLoc, CamLookAt)
#local ProxyCam =
box {
<-1, -1, -1>, <1, 1, 1>
translate CamLoc
transform {NoFall}
}
#local MinBox = min_extent(ProxyCam);
#local MaxBox = max_extent(ProxyCam);
#local MidPoint = ((MaxBox-MinBox)/2) + MinBox;
#local CamLoc_corr = CamLoc - MidPoint;
#declare Camera =
#if (FC)
camera {
perspective
location CamLoc
sky CamSky
up CamSky
direction z*CamZoom
right x*AspectRatio
angle CamAng
transform {NoFall}
translate CamLoc_corr
look_at CamLookAt
}
#else
camera {
perspective
location CamLoc
sky CamSky
up CamSky
direction z*CamZoom
right x*AspectRatio
angle CamAng
look_at CamLookAt
}
#end
camera {Camera}
//end code
But this is not as elegant as finding a way to do this already in the
macro ;-)
--
Thomas
Post a reply to this message
Attachments:
Download 'dj_fieldcam_test.png' (255 KB)
Preview of image 'dj_fieldcam_test.png'
|
|