1 \section{Choice of the view point
}
5 \begin{pspicture
}(-
5,-
5.7)(
10,
7)
6 \psset{lightsrc=
10 20 30,viewpoint=
50 30 20 rtp2xyz
}
7 \definecolor{bleuciel
}{rgb
}{0.78,
0.84,
0.99}
8 \psSolid[object=cube,fillcolor=bleuciel,a=
2,action=draw*
]%%
9 %\psSolid[object=cubemaillage,fillcolor=bleuciel,a=2]%%
10 \psSolid[object=grille,base=
0 8 0 10,action=draw
]%%
11 \psSolid[object=grille,base=
0 7 0 10,action=draw,RotY=
90](
0,
0,
7)
%
12 \psSolid[object=grille,base=
0 8 0 7,action=draw,RotX=-
90](
0,
0,
7)
%
13 \psSolid[object=cube,fillcolor=bleuciel,a=
1,action=draw*
](
0.5,
0.5,
0.5)
%
14 \psSolid[object=grille,base=-
1 1 -
1 1,action=draw,linecolor=blue
](
0,
0,
1)
%
15 \psSolid[object=grille,base=-
1 1 -
1 1,action=draw,RotY=
90,linecolor=blue
](
1,
0,
0)
%
16 \psSolid[object=grille,base=-
1 1 -
1 1,action=draw,RotX=-
90,linecolor=blue
](
0,
1,
0)
%
17 \axesIIID(
1,
1,
1)(
8,
10,
7)
19 /dV
12 def
% distance V
20 /dE
6 def
% distance \'{e}cran
36 % 5 distance \'{e}cran
37 %\psPoint(dE Theta cos mul Phi cos div dE Theta sin mul Phi cos div 0){Vq}
42 {\psset{linestyle=dashed,linecolor=red
}
43 \psline(V)(Vp)
\psline(Vx)(Vp)
\psline(Vy)(Vp)
\psline(V)(Vz)
\psline(V)(O)
\psline(Vp)(O)
}
44 %\psSolid[object=grille,base=-5 5 -3 3,action=draw,RotX=-60,linecolor=red](xE,yE,zE)%
45 \psTransformPoint[RotX=-
60](-
5 -
3 0)(xE,yE,zE)
{A
}
46 \psTransformPoint[RotX=-
60](-
5 3 0)(xE,yE,zE)
{B
}
47 \psTransformPoint[RotX=-
60](
5 3 0)(xE,yE,zE)
{C
}
48 \psTransformPoint[RotX=-
60](
5 -
3 0)(xE,yE,zE)
{D
}
49 \pspolygon[fillstyle=vlines,hatchcolor=yellow!
90,hatchwidth=
0.02,hatchsep=
0.04](A)(B)(C)(D)
52 \PointEcran(
1,
1,
1)
{S1
}
55 \psline[linestyle=dashed
](s1)(S1)
57 \PointEcran(
1,
1,-
1)
{S2
}
60 \psline[linestyle=dashed
](s2)(S2)
62 \PointEcran(-
1,
1,-
1)
{S3
}
65 \psline[linestyle=dashed
](s3)(S3)
67 \PointEcran(-
1,
1,
1)
{S4
}
70 \psline[linestyle=dashed
](s4)(S4)
72 \PointEcran(
1,-
1,-
1)
{S5
}
75 \psline[linestyle=dashed
](s5)(S5)
77 \PointEcran(
1,-
1,
1)
{S6
}
80 \psline[linestyle=dashed
](s6)(S6)
82 \PointEcran(-
1,-
1,
1)
{S7
}
85 \psline[linestyle=dashed
](s7)(S7)
96 %% here, we define the plantype object "Ecran"
99 dup xE yE zE planputorigine
103 %% uncomment follow line to draw "Ecran"
104 %\psSolid[object=plan,args=Ecran,showBase,planmarks]
105 \psProjection[object=texte,
108 text=Projection Screen
](-
2,
2)
111 \psset{linecolor=red,fillstyle=vlines,hatchsep=
0.04,hatchwidth=
0.02}
112 \pspolygon[hatchcolor=red!
60](S1)(S2)(S3)(S4)
113 \pspolygon[,hatchcolor=red!
60](S1)(S2)(S5)(S6)
114 \pspolygon[hatchcolor=red!
10](S1)(S4)(S7)(S6)
115 \psdots(s1)(s2)(s3)(s4)(s5)(s6)(s7)(S1)(S2)(S3)(S4)(S5)(S6)(S7)
116 \psbrace[ref=lC,linecolor=black
](V)(E)
{$D$
}
117 \uput[45](V)
{View Point
}
121 The coordinates of the object, in this case the bluish cube, are setup in the axes of coordinates $Oxyz$. The
\Index{coordinates
} of the
\Index{view point
} ($V$), are setup in the same axes of coordinates, either in
\Index{spherical coordinates
}---with the adding option
\verb+
[rtp2xyz
]+, or in Cartesian coordinates---which is the default option.
123 Example:
\verb+
[viewpoint=
50 30 20 rtp2xyz
]+
\qquad (here the notation with spherical coordinates)
130 \psSolid[object=plan,
133 args=
{[0 0 1 0] 180},
135 \psset{fontsize=
28.45,plan=P1
}
136 \psSolid[object=plan,
138 plangrid,action=none
]
139 \psProjection[object=texte,
141 text=pst-solides3d
](
0,
3.5)
142 \psSolid[object=sphere,r=
1,fillcolor=red!
25,ngrid=
18 36](
4,
4,
1)
143 \psSolid[object=cone,h=
3,r=
1,fillcolor=cyan,mode=
5](-
4,
4,
0)
144 \psSolid[object=cube,a=
2,fillcolor=magenta!
20](-
4,-
4,
1)
145 \psSolid[object=cylindre,r=
1,h=
4,fillcolor=blue!
20,ngrid=
4 16](
4,-
4,
0)
146 \axesIIID(
0,
0,
0)(
6,
6,
6)
150 \begin{pspicture
}(-
3,-
3)(
3,
3)
151 %\psframe(-5,-3)(4,4)
152 \psset{viewpoint=
20 25 15,Decran=
20,lightsrc=viewpoint,unit=
0.9}
154 \rput(
0,-
4)
{\texttt{viewpoint=
20 25 15}}
155 \end{pspicture
}\qquad\qquad\qquad\qquad
156 \begin{pspicture
}(-
3,-
3)(
3,
3)
157 %\psframe(-5,-3)(4,4)
158 \psset{viewpoint=-
10 0 30,Decran=
20,lightsrc=viewpoint,unit=
0.9}
160 \rput(
0,-
4)
{\texttt{viewpoint=-
10 0 30}}
164 \begin{pspicture
}(-
3,-
3)(
3,
4.5)
165 %\psframe(-5,-3)(4,4)
166 \psset{viewpoint=-
20 0 10,Decran=
10,lightsrc=viewpoint,unit=
0.9}
168 \rput(
0,-
4)
{\texttt{viewpoint=-
20 0 10}}
169 \end{pspicture
}\qquad\qquad\qquad\qquad
170 \begin{pspicture
}(-
3,-
3)(
3,
4.5)
171 %\psframe(-5,-3)(4,4)
172 \psset{viewpoint=-
20 -
10 25,Decran=
20,lightsrc=viewpoint,unit=
0.9}
174 \rput(
0,-
4)
{\texttt{viewpoint=-
20 -
10 25}}
177 \section{The definition of the option
\texttt{\Index{Decran
}}}
178 The
\Index{projection screen
} is placed perpendicular to the direction $OV$---central
179 perspective, at a distance $D$ from the view point $V$: We call that distance
180 `Decran', with the default value of
\texttt{\Lkeyword{Decran
}=
50}; this value can
181 either be positive or negative.
185 The following examples show the behaviour of the parameter
\Lkeyword{Decran
}.
188 \begin{pspicture
}(-
2,-
3)(
2.5,
3)
189 \psaxes[yAxis=false
](-
2,-
2)(
2,
2)
190 \psset{viewpoint=
0 0 5,Decran=
5}
191 \psSolid[object=grille,base=-
2 2 -
2 2]
192 \psSolid[object=vecteur,args=
0 0 0 2 2 0,linecolor=red,linewidth=
2pt
]
193 \axesIIID(
3,
3,
3)
\pnode(
2,-
2)
{B
}\pnode(
2,
2)
{A
}
196 \begin{pspicture
}(-
0.5,-
3)(
5,
3)
197 \psaxes[yAxis=false
](
0,-
2)(
5,
2)
198 \psset{viewpoint=
5 0 5,Decran=
5,RotX=-
90}
199 \psSolid[object=grille,base=-
2 2 -
2 2,RotX=
89.9]
200 \axesIIID[axisnames=
{x,z,y
}](
3,
3,
0)
201 \psdot(
5,
0)
\uput[0](
5,
0)
{V
}
202 \psline[tbarsize=
3mm
5]{<->|
}(
0,-
0.5)(
5,-
0.5)
\rput*(
2.5,-
0.5)
{$D=V$
}
203 \psline[linestyle=dashed
](
0,
2)(
5,
0)
\psline[linestyle=dashed
](
0,-
2)(
5,
0)
204 \uput[-
90](
0,-
2.5)
{Original
}\uput[-
90](
0,-
2.85)
{Image
}
205 \psline[linestyle=dotted
](A)(
0,
2)
206 \psline[linestyle=dotted
](B)(
0,-
2)
207 \rput(-
1,
2.75)
{Rotation:
}
208 \rput(-
1,
2.25)
{90$^
\circ$ around $x$
}
209 \psSolid[object=vecteur,args=
0 0 0 2 2 0,linecolor=red,linewidth=
2pt
]
210 \end{pspicture
}\\
[\normalbaselineskip]
212 \begin{pspicture
}(-
2,-
3)(
2.5,
3)
213 \psaxes[yAxis=false
](-
2,-
2)(
2,
2)
214 \psset{viewpoint=
0 0 5,Decran=
2.5}
215 \psSolid[object=grille,base=-
2 2 -
2 2]
216 \psSolid[object=vecteur,args=
0 0 0 2 2 0,linecolor=red,linewidth=
2pt
]
217 \axesIIID(
3,
3,
3)
\pnode(
1,-
1)
{B
}\pnode(
1,
1)
{A
}
220 \begin{pspicture
}(-
0.5,-
3)(
5,
3)
221 \psaxes[yAxis=false
](
0,-
2)(
5,
2)
222 \psset{viewpoint=
5 0 5,Decran=
2.5,RotX=-
90}
223 \psline[linewidth=
1pt
](
0,
2)(
0,-
2)
224 \psline[linewidth=
1.5pt,linecolor=red
]{->
}(
0,
0)(
0,-
2)
225 \psdot(
5,
0)
\uput[0](
5,
0)
{V
}
226 \psline[tbarsize=
3mm
5]{<->|
}(
0,
1.5)(
5,
1.5)
\rput*(
2.5,
1.5)
{$V$
}
227 \psline[linestyle=dashed
](
0,
2)(
5,
0)
\psline[linestyle=dashed
](
0,-
2)(
5,
0)
228 \psline[tbarsize=
3mm
5]{|<->|
}(
2.5,-
1.5)(
5,-
1.5)
\rput*(
3.75,-
1.5)
{$D$
}
229 \psline[linewidth=
1.5pt
](
2.5,
1)(
2.5,-
1)
230 \psline[linewidth=
1.5pt,linecolor=red
]{->
}(
2.5,
0)(
2.5,-
1)
231 \psline{->
}(
2.5,
0)(
3.5,
0)
\uput[0](
3.5,
0)
{$z$
}
232 \uput[-
90](
0,-
2.5)
{Original
}\uput[-
90](
2.5,-
2.5)
{Image
}
233 \psline[linestyle=dotted
](A)(
2.5,
1)
234 \psline[linestyle=dotted
](B)(
2.5,-
1)
235 \rput(-
1.5,
1.75)
{Rotation:
}
236 \rput(-
1.5,
1.25)
{90$^
\circ$ around $x$
}
241 If you keep the view point and make the
\Lkeyword{Decran
} value smaller, then the
242 image gets smaller. If you make the
\Lkeyword{Decran
} value larger, then the image gets larger.
244 Here are some examples, where we keep the same object, the same view point
245 and just vary the
\Lkeyword{Decran
} value:
248 \begin{pspicture
}(-
2,-
2)(
2,
2)
251 \psset{viewpoint=
0 50 0,Decran=
50}
252 %\psSolid[object=sphere,r=2,ngrid=18 36]
253 \psSolid[object=plan,definition=normalpoint,plangrid,linecolor=red,
254 base=-
2 2 -
2 2,args=
{0 0 0 [0 1 0 180]},name=monplan
]
256 \psProjection[object=texte,
261 \rput*(
0,-
1.75)
{\texttt{Decran=
50}}
262 \end{pspicture
}\qquad
263 \begin{pspicture
}(-
2,-
2)(
2,
2)
266 \psset{viewpoint=
0 50 0,Decran=
25}
267 %\psSolid[object=sphere,r=2,ngrid=18 36]
268 \psSolid[object=plan,definition=normalpoint,plangrid,linecolor=red,
269 base=-
2 2 -
2 2,args=
{0 0 0 [0 1 0 180]},name=monplan
]
271 \psProjection[object=texte,
276 \rput*(
0,-
1.75)
{\texttt{Decran=
25}}
277 \end{pspicture
}\qquad
278 \begin{pspicture
}(-
2,-
2)(
2,
2)
281 \psset{viewpoint=
0 50 0,Decran=-
50}
282 \psSolid[object=plan,definition=normalpoint,plangrid,linecolor=red,
283 base=-
2 2 -
2 2,args=
{0 0 0 [0 1 0 180]},name=monplan
]
285 \psProjection[object=texte,
290 \rput*(
0,-
1.75)
{\texttt{Decran=-
50}}