\documentclass[12pt,twocolumn]{article}
\usepackage[inline]{asymptote}
\usepackage[paper=a4paper,hmargin=2cm,vmargin=2.5cm]{geometry}
\usepackage{parskip}
\setlength{\columnsep}{3em}
\title{Asymptote 3D graphics}
\begin{document}
Purely 2D asymptote drawings:
\begin{asy}
size(5cm);
draw(circle((1,0), 1.5), blue);
draw(ellipse((1,0), 1.5, 0.5));
\end{asy}
3D asymptote drawings with \verb|import three;|
\begin{asy}
size(5cm,0);
import three;
currentprojection=orthographic(5,4,2);
draw(unitcube,magenta);
\end{asy}
\begin{asy}
size(6cm,0);
import bsp;
real u=2.5;
real v=1;
currentprojection=oblique;
path3 y=plane((2u,0,0),(0,2v,0),(-u,-v,0));
path3 l=rotate(90,Z)*rotate(90,Y)*y;
path3 g=rotate(90,X)*rotate(90,Y)*y;
face[] faces;
filldraw(faces.push(y),project(y),yellow);
filldraw(faces.push(l),project(l),lightgrey);
filldraw(faces.push(g),project(g),green);
add(faces);
\end{asy}
\begin{asy}
size(5cm,0);
import three;
draw(unitsphere,lightcyan);
\end{asy}
3D plots work too!
\begin{asy}
import graph3;
size(0,200);
size3(200,IgnoreAspect);
currentprojection=orthographic(4,6,3);
real x(real t) {return cos(2pi*t);}
real y(real t) {return sin(2pi*t);}
real z(real t) {return t;}
path3 p=graph(x,y,z,0,2.7,operator ..);
draw(p,Arrow3);
scale(true);
xaxis3(XZ()*"$x$",Bounds,red,InTicks(Label,2,2));
yaxis3(YZ()*"$y$",Bounds,red,InTicks(beginlabel=false,Label,2,2));
zaxis3(XZ()*"$z$",Bounds,red,InTicks);
\end{asy}
Awwww beautiful!
\begin{asy}
import graph3;
size(200,0);
currentprojection=perspective(10,8,4);
real f(pair z) {return 0.5+exp(-abs(z)^2);}
draw((-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle);
draw(arc(0.12Z,0.2,90,60,90,25),ArcArrow3);
surface s=surface(f,(-1,-1),(1,1),nx=5,Spline);
xaxis3(Label("$x$"),red,Arrow3);
yaxis3(Label("$y$"),red,Arrow3);
zaxis3(XYZero(extend=true),red,Arrow3);
draw(s,lightgray,meshpen=black+thick(),nolight,render(merge=true));
label("$O$",O,-Z+Y,red);
\end{asy}
\textbf{Download the PDF and open it in a suitable viewer like Adobe Reader. You'll get interactive views of the 3D objects!}
\end{document}