summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-solides3d/doc-en/par-eclairageponctuel_en_corr.tex
blob: faa69d9396fb383b59b315c0129cdee01054afed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
\section{Lighting by a punctional light source}

Two parameters, the first one positions the light source, the second one sets the light intensity:
\begin{itemize}
    \item \texttt{[lightsrc=20 30 50]} in Cartesian coordinates, or
\texttt{[lightsrc=viewpoint]} to put the light source to the same position as the view point.
    \item \texttt{[lightintensity=2]} (default value).
\end{itemize}

\begin{LTXexample}[width=6cm]
\psset{unit=0.3}
\begin{pspicture}(-10.5,-5)(7.5,4)
\psset{Decran=1e3,
    viewpoint=500 0 1000,
    lightsrc=viewpoint,mode=4}
\psSolid[object=cube,RotZ=30](0,2,0)
\psSolid[object=cylindrecreux,
    RotX=30,RotZ=-30,
    fillcolor=cyan,incolor=red](4,-3,0)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6cm]
\psset{unit=0.3}
\begin{pspicture}(-9,-4)(4,5)
\psset{Decran=30,viewpoint=30 10 20,
    lightsrc=viewpoint,mode=3}
\psSolid[object=cube,lightintensity=3,
    RotX=90,fillcolor=yellow](0,3,0)
\psSolid[object=cube,lightintensity=1,
    RotX=90,fillcolor=yellow](3,-3,0)
\end{pspicture}
\end{LTXexample}


When the option \verb+[lightsrc=value1 value2 value3]+
is not specified, the object is uniformly illuminated.

\begin{center}
 \begin{pspicture}(-6,-4)(6,4)
\psframe(-6,-4)(6,4)
\psset{viewpoint=50 50 30 rtp2xyz,Decran=40}
\psSolid[object=datfile,file=tore1836,deactivatecolor]
 %\psSolid[r1=3.5,r0=1,object=tore,ngrid=18 36,fillcolor={[rgb]{.372 .62 .628}}]%
 \axesIIID(0,4.5,0)(6,6,4)
 \end{pspicture}
\end{center}
\begin{verbatim}
 \psSolid[r1=3.5,r0=1,object=tore,ngrid=18 36,fillcolor={[rgb]{.372 .62 .628}}]%
\end{verbatim}

\endinput