Initialisation du projet pst-solides3d.git (SVN revision 142)
[pst-solides3d.git] / doc / par-choixpointdevue.tex
1 \section {Choix du point de vue}
2 \begin{center}
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
19 /Theta 60 def
20 /Phi 30 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
24 /xE Kc xV mul def
25 /yE Kc yV mul def
26 /zE Kc zV mul def
27 }%
28 \psPoint(xV,yV,zV){V}
29 \psPoint(xE,yE,zE){E}
30 \psPoint(xV,yV,0){Vp}
31 % 5 distance écran
32 %\psPoint(dE Theta cos mul Phi cos div dE Theta sin mul Phi cos div 0){Vq}
33 \psPoint(xV,0,0){Vx}
34 \psPoint(0,yV,0){Vy}
35 \psPoint(0,0,zV){Vz}
36 \psdot(V)
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}
46 \psPoint(1,1,1){s1}
47 \psline(s1)(S1)(V)
48 %
49 \PointEcran(1,1,-1){S2}
50 \psPoint(1,1,-1){s2}
51 \psline(s2)(S2)(V)
52 %
53 \PointEcran(-1,1,-1){S3}
54 \psPoint(-1,1,-1){s3}
55 \psline(s3)(S3)(V)
56 %
57 \PointEcran(-1,1,1){S4}
58 \psPoint(-1,1,1){s4}
59 \psline(s4)(S4)(V)
60 %
61 \PointEcran(1,-1,-1){S5}
62 \psPoint(1,-1,-1){s5}
63 \psline(s5)(S5)(V)
64 %
65 \PointEcran(1,-1,1){S6}
66 \psPoint(1,-1,1){s6}
67 \psline(s6)(S6)(V)
68 %
69 \PointEcran(-1,-1,1){S7}
70 \psPoint(-1,-1,1){s7}
71 \psline(s7)(S7)(V)
72 %
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)
78 %
79 \uput[45](V){$V$}
80 \end{pspicture}
81 \end{center}
82
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]},
88
89 Exemple : \Cadre{[viewpoint=50 30 20 rtp2xyz]}
90
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.

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.