I'm trying to draw a 3D picture with some shading to make it look a bit prettier. So far it's just a cuboid, and I discovered the shading command. Here is what I have so far:
\documentclass[varwidth, border=5pt]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}
\begin{document}
\begin{tikzpicture}
\shade[bottom color=blue, top color = white] (0,0,0) -- (0.5,0,0) -- (0.5,2,0) -- (0,2,0) -- cycle;
\shade[bottom color=white, top color=blue] (0,2,0) -- (0,2,-2) -- (0.5,2,-2) -- (0.5,2,0) -- cycle;
\shade[shading=axis,shading angle=45,left color=blue, right color=white] (0.5,0,0) -- (0.5,2,0) -- (0.5,2,-2) -- (0.5,0,-2) -- cycle;
\end{tikzpicture}
\end{document}
My problem is that defining shading angle=45
doesn't work. I can only get shading going from top to bottom, or left to right. Is there a way of defining the shading to go from one corner to another?
Thanks.
Edit: Maybe some technique using radial shading would work? But I'd need to be able to change the centre of the radial shading from the centre of the rectangle to the corner.