[pstricks] Need help with pst-3d

Alan Ristow ristow at ece.gatech.edu
Thu Feb 6 23:08:44 CET 2003


Wow! That was quick -- thanks! That is very much like what I'm after, though
I have to admit that I'm still having a hard time understanding *why* it
works. There are also a couple of other things I'd like to do but have no
idea how to handle. (Comments below, I've left the code completely intact
for clarity.)

> \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$}
> 	}

I don't think I fully understand the syntax of \ThreeDput. What is the
function of the (0,0,0) after the bracketed part of the command?

> 	\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%
> 	}

Here I'm still trying to convince myself that the origin of \orthovectors is
at (1.5,2.5,0). It doesn't really look right, but I might be able to figure
it out myself if I knew what the  values in round parentheses mean. How did
you determine that [normal=1.5 2.5 0](0,0,0) would put the origin of
\orthovectors at (1.5,2.5,0)?

> 	% 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%
> 	}

Let me guess: This offsets \orthovectors two units in the z direction?

> %--------------------------------------------------
> 	\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}

One more thing: If I wish to rotate \orthovectors, is there a PSTricks
command that will do it or do I need to add arguements via the usual
\newcommand route?

Thanks so much for your help!

alan



More information about the PSTricks mailing list