summaryrefslogtreecommitdiff
path: root/graphics/asymptote/base/v3d.asy
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-01-21 03:01:16 +0000
committerNorbert Preining <norbert@preining.info>2022-01-21 03:01:16 +0000
commit5d5f239204f5c0d1f7573c9ebc64b5ad1ae75b49 (patch)
treedd2a2d9a64fd0be0785bc558a4872a3c8185af23 /graphics/asymptote/base/v3d.asy
parent217d27e597baa589f8e115e1b44eef51c7bb5dd0 (diff)
CTAN sync 202201210301
Diffstat (limited to 'graphics/asymptote/base/v3d.asy')
-rw-r--r--graphics/asymptote/base/v3d.asy17
1 files changed, 13 insertions, 4 deletions
diff --git a/graphics/asymptote/base/v3d.asy b/graphics/asymptote/base/v3d.asy
index 925ba505e4..5bdd0627d5 100644
--- a/graphics/asymptote/base/v3d.asy
+++ b/graphics/asymptote/base/v3d.asy
@@ -33,7 +33,8 @@ struct CameraInformation
bool orthographic;
real angle;
real Zoom0;
- pair viewportMargin;
+ pair viewportshift;
+ pair viewportmargin;
light light;
@@ -43,9 +44,13 @@ struct CameraInformation
triple center=0.5*(b.z+B.z)*Z;
if(orthographic)
- currentprojection=orthographic(Z,target=center);
+ currentprojection=orthographic(Z,target=center,Zoom0,
+ viewportshift=viewportshift);
else
- currentprojection=perspective(Z,Y,target=center,Zoom0,degrees(angle),autoadjust=false);
+ currentprojection=perspective(Z,Y,target=center,Zoom0,
+ degrees(2.0*atan(tan(0.5*angle)/Zoom0)),
+ viewportshift=viewportshift,
+ autoadjust=false);
light.specular=light.diffuse;
currentlight=light;
}
@@ -204,9 +209,13 @@ struct v3dfile
{
ci.Zoom0=xdrfile;
}
+ else if (headerKey==v3dheadertypes.viewportShift)
+ {
+ ci.viewportshift=xdrfile;
+ }
else if (headerKey==v3dheadertypes.viewportMargin)
{
- ci.viewportMargin=xdrfile;
+ ci.viewportmargin=xdrfile;
}
else if (headerKey==v3dheadertypes.background)
{