1 \section {Choix du point de vue}
3 \psset{lightsrc=10 20 30,viewpoint=50 30 20 rtp2xyz}
4 \begin{pspicture}(-5,-5.7)(10,7)
5 \definecolor{bleuciel}{rgb}{0.78,0.84,0.99}
6 \psSolid[object=cube,fillcolor=bleuciel,a=2,action=draw*]%%
7 %\psSolid[object=cubemaillage,fillcolor=bleuciel,a=2]%%
8 \psSolid[object=grille,base=0 8 0 10,action=draw]%%
9 \psSolid[object=grille,base=0 7 0 10,action=draw,RotY=90](0,0,7)%
10 \psSolid[object=grille,base=0 8 0 7,action=draw,RotX=-90](0,0,7)%
11 \psSolid[object=cube,fillcolor=bleuciel,a=1,action=draw*](0.5,0.5,0.5)%
12 \psSolid[object=grille,base=-1 1 -1 1,action=draw,linecolor=blue](0,0,1)%
13 \psSolid[object=grille,base=-1 1 -1 1,action=draw,RotY=90,linecolor=blue](1,0,0)%
14 \psSolid[object=grille,base=-1 1 -1 1,action=draw,RotX=-90,linecolor=blue](0,1,0)%
15 \axesIIID(1,1,1)(8,10,7)
16 \pstVerb{/dV 12 def % distance V
17 /dE 6 def % distance écran
18 /Kc dV dE sub dV div def
21 /xV dV Phi cos mul Theta cos mul def
22 /yV dV Phi cos mul Theta sin mul def
23 /zV dV Phi sin mul def
32 %\psPoint(dE Theta cos mul Phi cos div dE Theta sin mul Phi cos div 0){Vq}
37 {\psset{linestyle=dashed,linecolor=red}
38 \psline(V)(Vp)\psline(Vx)(Vp)\psline(Vy)(Vp)\psline(V)(Vz)\psline(V)(O)\psline(Vp)(O)}
39 \psSolid[object=grille,base=-5 5 -3 3,action=draw,RotX=-60,linecolor=red](xE,yE,zE)%
40 \psTransformPoint[RotX=-60](-5 -3 0)(xE,yE,zE){A}
41 \psTransformPoint[RotX=-60](-5 3 0)(xE,yE,zE){B}
42 \psTransformPoint[RotX=-60](5 3 0)(xE,yE,zE){C}
43 \psTransformPoint[RotX=-60](5 -3 0)(xE,yE,zE){D}
44 \pspolygon[fillstyle=vlines,hatchcolor=yellow!50,hatchwidth=0.02,hatchsep=0.04](A)(B)(C)(D)
45 \PointEcran(1,1,1){S1}
49 \PointEcran(1,1,-1){S2}
53 \PointEcran(-1,1,-1){S3}
57 \PointEcran(-1,1,1){S4}
61 \PointEcran(1,-1,-1){S5}
65 \PointEcran(1,-1,1){S6}
69 \PointEcran(-1,-1,1){S7}
73 \psset{linecolor=red,fillstyle=vlines,hatchsep=0.04,hatchwidth=0.02}
74 \pspolygon[hatchcolor=red!60](S1)(S2)(S3)(S4)
75 \pspolygon[,hatchcolor=red!60](S1)(S2)(S5)(S6)
76 \pspolygon[hatchcolor=red!10](S1)(S4)(S7)(S6)
77 \psdots(s1)(s2)(s3)(s4)(s5)(s6)(s7)(S1)(S2)(S3)(S4)(S5)(S6)(S7)
83 Les coordonnées de l'objet, ici le cube bleuté, sont données dans le
84 repère $Oxyz$. Les coordonnées du point de vue ($V$), sont données
85 dans ce même repère, soit en coordonnées cartésiennes qui
86 est l'option par défaut, soit en coordonnées sphériques en ajoutant
87 l'opérateur \Cadre{[rtp2xyz]},
89 Exemple : \Cadre{[viewpoint=50 30 20 rtp2xyz]}
91 L'écran est placé perpendiculairement à la direction $OV$, à une
92 distance de $V$ : \Cadre{[Decran=50]} (valeur par défaut), cette
93 valeur peut être positive ou négative.