我想在 Asymptote 中制作 3D。
我的代码:
> import three;
import graph3;
//import solids;
currentprojection=orthographic(8,4,2,center=true);
size(10cm);
size3(3cm,5cm,8cm);
draw(unitbox,dashed);
dot(unitbox,red);
xaxis3(Label("$x$",1),xmax=1.25,Arrow3);
yaxis3(Label("$y$",1),ymax=1.25,Arrow3);
zaxis3(Label("$z$",1),zmax=1.25,Arrow3);
xaxis3(Label("$\hat{x}$",.5),xmax=.5,Arrow3);
yaxis3(Label("$\hat{y}$",.5),ymax=.5,Arrow3);
zaxis3(Label("$\hat{z}$",.5),zmax=.5,Arrow3);
label("$O$",(0,0,0),NW);
draw ((0,0,0) --(1,1,1),Arrow3);
请帮助我!谢谢 :)
答案1
这是在以下人员的帮助下完成的本教程并由同一作者使用asypictureB
。例如,使用 可获得结果pdflatex -shell-escape
。
\documentclass{standalone}
\usepackage{asypictureB}
\standaloneenv{asypicture}
\begin{document}
\begin{asypicture}{name=disc}
settings.outformat = "pdf";
settings.prc = false;
settings.render = 0;
import three;
import graph3;
//import solids;
currentprojection=orthographic(8,4,2,center=true);
size(10cm);
size3(3cm,5cm,8cm);
draw(unitbox,dashed);
dot(unitbox,red);
xaxis3(Label("$x$",1),xmax=1.25,Arrow3);
yaxis3(Label("$y$",1),ymax=1.25,Arrow3);
zaxis3(Label("$z$",1),zmax=1.25,Arrow3);
xaxis3(Label("$\hat{x}$",.5),xmax=.5,Arrow3);
yaxis3(Label("$\hat{y}$",.5),ymax=.5,Arrow3);
zaxis3(Label("$\hat{z}$",.5),zmax=.5,Arrow3);
label("$O$",(0,0,0),NW);
draw ((0,0,0) --(1,1,1),Arrow3);
draw(arc(c=O,0.5*X,X+Y+Z), L = Label("$\alpha$", position=MidPoint,align=(0,1)));
draw(arc(c=O,0.5*Y,X+Y+Z), L = Label("$\beta$", position=MidPoint,align=(0,1)));
draw(arc(c=O,0.5*Z,X+Y+Z), L = Label("$\gamma$", position=MidPoint,align=(0,1)));
\end{asypicture}
\end{document}