2 \section {Positionner un solide}
3 \subsection{Translation}
5 \verb+\psSolid[object=cube,+\textsl{options}\verb+](x,y,z)+ déplace le
6 centre du cube au point de coordonnées $\mathtt{(x,y,z)}$.
8 L'exemple suivant va recopier le cube d'arête 1 \begin{pspicture}(-0.5,-0.5)(.5,.5)
9 \psset{Decran=40,viewpoint=50 35 35,a=1,lightsrc=50 30 20}
10 \psset{fillcolor=yellow,mode=3,
20 \psSolid[object=cube](0.5,0.5,0.5)% c1
22 aux points de coordonnées $\mathtt{(0.5,0.5,0.5)}$, $\mathtt{(4.5,0.5,0.5)}$ etc. afin que ces copies occupent les coins d'un cube d'arête 5.
24 \begin{pspicture}(-4,-5)(5,5)
26 %\psset{SphericalCoor,Decran=3,viewpoint=10 35 35,a=1,lightsrc=50 20 10}
27 \psset{Decran=40,viewpoint=50 35 35,a=1,lightsrc=50 30 20,
37 \psSolid[object=grille,base=0 6 0 6,fillcolor=blue!50]%%
38 \psSolid[object=grille,base=0 6 0 6,RotY=90,fillcolor=blue!40](0,0,6)%
39 \psSolid[object=grille,base=0 6 0 6,RotX=-90,fillcolor=blue!30](0,0,6)%
40 \psPoint(1,0.5,0.5){c11}
41 \psPoint(0.5,0.5,1){c12}
42 \psPoint(0.5,1,0.5){c13}
43 \psPoint(4.5,4.5,1){c21}
44 \psPoint(4,4.5,0.5){c22}
45 \psPoint(4.5,4,0.5){c23}
46 \psPoint(4,0.5,0.5){c41}
47 \psPoint(4.5,0.5,1){c42}
48 \psPoint(4.5,1,0.5){c43}
49 \psPoint(0.5,4,0.5){c51}
50 \psPoint(0.5,4.5,1){c52}
51 \psPoint(1,4.5,0.5){c53}
52 \psPoint(0.5,0.5,4){c61}
53 \psPoint(0.5,1,4.5){c62}
54 \psPoint(1,0.5,4.5){c63}
55 \psPoint(4,0.5,4.5){c71}
56 \psPoint(4.5,1,4.5){c72}
57 \psPoint(4.5,0.5,4){c73}
58 \axesIIID(1,1,1)(6,6,6)
59 {\psset{fillcolor=yellow,mode=3}
60 \psSolid[object=cube](0.5,0.5,0.5)% c1
61 \psline[linestyle=dashed,linecolor=red](c11)(c41)
62 \psline[linestyle=dashed,linecolor=red](c12)(c61)
63 \psline[linestyle=dashed,linecolor=red](c13)(c51)
64 \psSolid[object=cube](4.5,0.5,0.5)
65 \psSolid[object=cube](0.5,4.5,0.5)
66 \psSolid[object=cube](0.5,0.5,4.5)
67 \psSolid[object=cube](4.5,4.5,4.5)
68 \psSolid[object=cube](4.5,0.5,4.5)
69 \psSolid[object=cube](4.5,4.5,0.5)
70 \psSolid[object=cube](0.5,4.5,4.5)}
71 \psSolid[object=grille,base=0 5 0 5,action=draw,linecolor=gray!50](0,0,5)%
72 \psSolid[object=grille,base=0 5 0 5,action=draw,linecolor=gray!50,RotY=90](5,0,5)%
73 \psSolid[object=grille,base=0 5 0 5,action=draw,RotX=-90,linecolor=gray!50](0,5,5)%
77 \psset{fillcolor=yellow,mode=3}
78 \psSolid[object=cube](0.5,0.5,0.5)
79 \psSolid[object=cube](4.5,0.5,0.5)
80 \psSolid[object=cube](0.5,4.5,0.5)
81 \psSolid[object=cube](0.5,0.5,4.5)
82 \psSolid[object=cube](4.5,4.5,4.5)
83 \psSolid[object=cube](4.5,0.5,4.5)
84 \psSolid[object=cube](4.5,4.5,0.5)
85 \psSolid[object=cube](0.5,4.5,4.5)
88 La rotation s'effectue dans l'ordre autour des axes $Ox$, $Oy$ et $Oz$. Prenons l'exemple d'un parallélépipède rectangle,
89 \begin{pspicture}(-1,-0.2)(1,.5)
90 \psset{Decran=40,viewpoint=50 35 35,a=2,b=3,c=1,lightsrc=50 30 30}
91 \psset{fillcolor=yellow,unit=0.5,
99 \psSolid[object=parallelepiped](0.5,0.5,0.5)%
101 que l'on va faire tourner
102 successivement autour des axes $Ox$, $Oy$ et $Oz$.
105 \psset{Decran=40,viewpoint=50 35 35,a=2,b=3,c=1}
114 object=parallelepiped}
115 \setlength{\columnseprule}{1pt}
117 \begin{pspicture}(-2.5,-2.5)(2.5,2.5)
118 \psframe(-2.5,-2.5)(2.5,2.5)
120 \axesIIID(1,1.5,1)(3,3,2)
124 \begin{pspicture}(-2.5,-2.5)(2.5,2.5)
125 \psframe(-2.5,-2.5)(2.5,2.5)
127 \psSolid[action=draw,linewidth=0.5\pslinewidth]%%
128 \axesIIID(1,1.5,1)(2,3,2)
131 \centerline{\texttt{[RotZ=60]}}
135 \begin{pspicture}(-2.5,-2.5)(2.5,2.5))
136 \psframe(-2.5,-2.5)(2.5,2.5)
138 \psSolid[action=draw,linewidth=0.5\pslinewidth]%%
139 \axesIIID(1,1.5,1)(2,3,2)
142 \centerline{\texttt{[RotX=30]}}
146 \begin{pspicture}(-2.5,-2.5)(2.5,2.5)
147 \psframe(-2.5,-2.5)(2.5,2.5)
149 \psSolid[action=draw,linewidth=0.5\pslinewidth]%%
150 \axesIIID(1,1.5,1)(2,3,2)
153 \centerline{\texttt{[RotY=-45]}}