如果我画一个 Arrow3,它看起来并不像 3D 风格,因为线条不像圆柱体那样有阴影。我该如何改变这种情况?可能需要手动将圆柱体和箭头一起绘制?如何做?
以下是显示尚无圆柱部分的箭头的 MWE:
size(700);
import solids;
import texcolors;
import three;
currentprojection=orthographic (
camera=(8,4,4),
up=(0,0,1),
target=(2,2,2),
zoom=0.8
);
// save predefined 2D orientation vectors
pair NN=N;
pair SS=S;
pair EE=E;
pair WW=W;
draw((1.3094,0,2.26599)--(3.3094,0,4.26599),(7bp)+green,Arrow3(size=30bp));
答案1
只需将currentlight
参数添加到绘制函数即可快速修复。有关 Asymptote 提供的着色和材质选项的更完整解释,请参阅以下问题:
完整代码如下:
size(700);
import solids;
import texcolors;
import three;
currentprojection=orthographic (
camera=(8,4,4),
up=(0,0,1),
target=(2,2,2),
zoom=0.8
);
// save predefined 2D orientation vectors
pair NN=N;
pair SS=S;
pair EE=E;
pair WW=W;
draw((1.3094,0,2.26599)--(3.3094,0,4.26599),(7bp)+green,Arrow3(size=30bp),currentlight);