[pstricks] Need help with pst-3d
Herbert Voss
Herbert.Voss at alumni.TU-Berlin.DE
Thu Feb 6 22:15:56 CET 2003
Alan Ristow schrieb:
> I've separated the drawing of the coordinate axes and the orthogonal vectors
> for clarity. What I would like here is three orthogonal vectors with an
> origin at (x,y,z)=(1.5,2.5,0). Clearly the final \psline command does not
> give me this. I've tried messing with the location of the origin and such,
> to no avail.
something like the following?
Herbert
\documentclass[10pt]{article}
\usepackage{pst-3d}
\newcommand{\orthovectors}{%
\begin{pspicture}(1in,1in)
\psset{linewidth=2pt,linecolor=red}%
\ThreeDput[normal=0 0 1](0,0,0){%
\psline{->}(0,0)(1,0)
\uput[90](1,0){$x$}
}
\ThreeDput[normal=1 0 0](0,0,0){%
\psline{->}(0,0)(1,0)
\uput[90](1,0){$y$}
\psline{->}(0,0)(0,1)
\uput[180](0,1){$z$}
}
\end{pspicture}
}
\begin{document}
\begin{pspicture}[-0.2](-2in,-1in)(2in,2in)
\psset{viewpoint=1 1 1}%
\ThreeDput[normal=1.5 2.5 0](0,0,0){%
\orthovectors%
}
% Draw coordinate axes
\ThreeDput[normal=0 0 1](0,0,0){%
\psline{->}(0,0)(3,0)
\uput[90](3,0){$x$}
}
\ThreeDput[normal=1 0 0](0,0,0){%
\psline{->}(0,0)(3,0)
\uput[90](3,0){$y$}
\psline{->}(0,0)(0,3)
\uput[180](0,3){$z$}
}
% Draw orthogonal vectors
%--------------------------------------------------
\ThreeDput[normal=1.5 2.5 0](0,0,0){%
\orthovectors%
}
\ThreeDput[normal=1.5 2.5 0](0,0,2){%
\orthovectors%
}
%--------------------------------------------------
\ThreeDput[normal=0 0 1]{%
\psline[linewidth=1.5pt]{->}(1.5,2.5)(1,2.1)%
\psline[linewidth=1.5pt]{->}(1.5,2.5)(1.9,2)%
}%
\ThreeDput[normal=0 1 0]{%
\psline[linewidth=1.5pt]{->}(1.5,2.5)(0,1)%
}%
\end{pspicture}
\end{document}
More information about the PSTricks
mailing list