Asymptote can draw standard shapes (spheres, cylinders, cubes, etc) which you can then scale, rotate, and shift to create many other shapes.
\documentclass[border=10pt]{standalone}\usepackage[inline]{asymptote}\begin{document}\begin{asy}import three;settings.render = 0;//Setup Viewsize(200);currentprojection=orthographic(5,4,2);//Draw Axespen thickblack = black+0.75;real axislength = 2.0;draw(L=Label("$x$", position=Relative(1.1), align=SW), -axislength*X--axislength*X,thickblack, Arrow3);draw(L=Label("$y$", position=Relative(1.1), align=E), -axislength*Y--axislength*Y,thickblack, Arrow3);draw(L=Label("$z$", position=Relative(1.1), align=N), -2*axislength*Z--2*axislength*Z,thickblack, Arrow3);//Define cube surfacessurface c1 = unitcube;surface c2 = shift(-2Z)*rotate(45,X)*c1;surface s1 = unitsphere;surface s2 = rotate(75,Z)*shift(1.5Z)*xscale3(2)*yscale3(0.5)*zscale3(0.1)*s1;//Draw cube surfacesdraw(c1,palegrey);draw(c2,green);draw(s2,red);\end{asy}\end{document}
Source: TeX.SE
Author: Chris Chudzicki (License)