summaryrefslogtreecommitdiff
path: root/obsolete/graphics/pstricks/contrib/pst-vue3d/pst-vue3d-doc.tex
blob: e0808473fc17af35aeadd21218125e5c60400305 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
\listfiles
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{lmodern}% only for PDF output
%\usepackage[scaled=0.9]{luximono}
\usepackage[a4paper,bmargin=2cm,tmargin=2cm]{geometry}
\usepackage{url}
\usepackage{morefloats}
\setcounter{totalnumber}{10}
\setcounter{dbltopnumber}{10}
\renewcommand{\textfraction}{0}
\usepackage{subfig}
% Mluque5130@aol.com
% 17 octobre 2003
% Herbert Voss <voss@pstricks.de>
% March 2007
\def\UrlFont{\small\ttfamily}
\makeatletter
\def\verbatim@font{\small\normalfont\ttfamily}
\makeatother
\usepackage[colorlinks,linktocpage]{hyperref}
\usepackage[english]{babel}
\usepackage{pstricks,multido,pst-grad}
\usepackage{pst-vue3d}
\let\VueFversion\fileversion
\usepackage{showexpl}
\def\PS{PostScript}
%
\definecolor{GrisClair} {rgb}{0.6,0.7,0.8}
\definecolor{GrisTresClair} {rgb}{0.8,0.9,0.7}
\definecolor{GrayA} {rgb}{0.35,0.95,0.95}
\definecolor{GrayB} {rgb}{0.85,0.85,0.35}
\definecolor{GrayC} {rgb}{0.75,0.35,0.55}
\definecolor{GrayD} {rgb}{0.65,0.65,0.65}
\definecolor{GrayE} {rgb}{0.7,0.9,0.65}
\definecolor{LightBlue}{rgb}{.68,.85,.9}
%
\newcommand\tapis{%
	\psset{normaleLatitude=90,normaleLongitude=0}
	\FrameThreeD[fillcolor=green,fillstyle=solid](0,0,-5)(-20,-20)(20,20)
	\QuadrillageThreeD[grille=10](0,0,-5)(-20,-20)(20,20)%
}
%
\def\Table{{%
    \CubeThreeD[A=30,B=30,C=2,CubeColorFaceOne={.7 .6 .5}](0,0,-2)
    \psset{normaleLongitude=0,normaleLatitude=90}
    \QuadrillageThreeD[linewidth=0.2mm,linecolor=white,%
		grille=5](0,0,0)(-30,-30)(30,30)
}}
%
\def\DessusTable{{%
    \psset{normaleLongitude=0,normaleLatitude=90}
    \QuadrillageThreeD[linewidth=0.2mm,linecolor=gray,%
		grille=5](0,0,0)(-30,-30)(30,30)%
}}
\def\PlansOXYZ{{%
	\psset{normaleLongitude=0,normaleLatitude=90}
	\FrameThreeD[fillstyle=solid,fillcolor=GrisClair](0,0,0)(-50,0)(0,50)
	\QuadrillageThreeD[linewidth=0.2mm,grille=10](0,0,0)(-50,0)(0,50)%
	\psset{normaleLongitude=90,normaleLatitude=0}
	\FrameThreeD[fillstyle=solid,fillcolor=GrisTresClair](0,0,0)(0,0)(50,-50)
	\QuadrillageThreeD[linewidth=0.2mm,grille=10](0,0,0)(0,-50)(50,0)%
	\psset{normaleLongitude=0,normaleLatitude=0}
	\FrameThreeD[fillstyle=solid,fillcolor=GrisTresClair](0,0,0)(-50,0)(0,-50)
	\QuadrillageThreeD[linewidth=0.2mm,grille=10](0,0,0)(-50,-50)(0,0)%
	}}
\psset{CubeColorFaceOne=1 1 1,%
       CubeColorFaceTwo=1 0 0,%
       CubeColorFaceThree=0 1 0,%
       CubeColorFaceFour=0 0 1,%
       CubeColorFaceFive=1 1 0,%
       CubeColorFaceSix=0 1 1}
%
\def\hexagon{%
\begin{pspicture}(-2.2,-2.2)(2.2,2)
    \Table
    \pNodeThreeD(-8.66,-5,0){A6}
    \pNodeThreeD(-8.66,5,0){A1}
    \pNodeThreeD(0,10,0){A2}
    \pNodeThreeD(8.66,5,0){A3}
    \pNodeThreeD(8.66,-5,0){A4}
    \pNodeThreeD(0,-10,0){A5}%
    \psclip{\pspolygon[fillstyle=solid,fillcolor=GrisClair,%
        linestyle=none](A1)(A2)(A3)(A4)(A5)(A6)}
        \DessusTable
    \endpsclip
    \psset{A=5,B=5,C=5}
    \CubeThreeD[RotZ=60](-6.83,-11.830,5)%6
    \CubeThreeD[RotZ=120](6.83,-11.830,5)%5
    \CubeThreeD(-13.86,0,5)%1
    \CubeThreeD[RotZ=-60](-6.83,11.830,5)%2
    \CubeThreeD[RotZ=-120](6.83,11.830,5)%3
    \CubeThreeD[RotZ=180](13.86,0,5)%4
\end{pspicture}%
}
%
\def\stardodecagon{%
    \begin{pspicture}(-2.2,-2)(2.2,2.2)
    \Table
    \pNodeThreeD(-6.83,-11.83,0){A6}%
    \pNodeThreeD(-13.86,0,0){A1}%
    \pNodeThreeD(-6.83,11.83,0){A2}%
    \pNodeThreeD(6.83,11.83,0){A3}%
    \pNodeThreeD(13.86,0,0){A4}%
    \pNodeThreeD(6.83,-11.83,0){A5}%
    \psclip{\pspolygon[fillstyle=solid,fillcolor=GrisClair,%
        linestyle=none](A1)(A2)(A3)(A4)(A5)(A6)}
        \DessusTable
    \endpsclip%
    \psset{A=5,B=5,C=5}
    \CubeThreeD[RotZ=105](-10.6066,6.12372,5)%2
    \CubeThreeD[RotZ=45](0,12.2474,5)%1
    \CubeThreeD[RotZ=345](10.6066,6.12372,5)%6
    \CubeThreeD[RotZ=165](-10.6066,-6.12372,5)%3
    \CubeThreeD[RotZ=225](0,-12.2474,5)%4
    \CubeThreeD[RotZ=285](10.6066,-6.12372,5)%5
\end{pspicture}}
%
\def\pentagon{%
    \begin{pspicture}(-2.2,-2.2)(2.2,2.2)
    \Table
    \pNodeThreeD(8.5065,0,0){A1}%
    \pNodeThreeD(2.6287,8.09,0){A2}%
    \pNodeThreeD(-6.882,5,0){A3}%
    \pNodeThreeD(-6.882,-5,0){A4}%
    \pNodeThreeD(2.6287,-8.09,0){A5}%
    \psclip{\pspolygon[fillstyle=solid,fillcolor=GrisClair,%
        linestyle=none](A1)(A2)(A3)(A4)(A5)}
        \DessusTable
    \endpsclip%
    \psset{A=5,B=5,C=5}
    \CubeThreeD(-11.88,0,5)%1
    \CubeThreeD[RotZ=72](-3.617,-11.3,5)%5
    \CubeThreeD[RotZ=-72](-3.617,11.3,5)%2
    \CubeThreeD[RotZ=-144](9.61267,6.984,5)%3
    \CubeThreeD[RotZ=144](9.61267,-6.984,5)%4
\end{pspicture}}
%
\def\stardecagon{%
    \begin{pspicture}*(-2.2,-1.75)(2.2,2.2)
    \Table
    \pNodeThreeD(-12.03,0,0){A1}%
    \pNodeThreeD(-3.7178,-11.44,0){A2}%
    \pNodeThreeD(9.7325,-7.071,0){A3}%
    \pNodeThreeD(9.7325,7.071,0){A4}%
    \pNodeThreeD(-3.7178,11.44,0){A5}%
    \psclip{\pspolygon[fillstyle=solid,fillcolor=GrisClair,%
        linestyle=none](A1)(A2)(A3)(A4)(A5)}
        \DessusTable
    \endpsclip%
    \psset{A=5,B=5,C=5}
    \CubeThreeD[RotZ=81](-7.87375,-5.72061,5)%4
    \CubeThreeD[RotZ=9](-7.87375,5.72061,5)%3
    \CubeThreeD[RotZ=153](3.0075,-9.2561,5)%5
    \CubeThreeD[RotZ=-63](3.0075,9.25615,5)%2
    \CubeThreeD[RotZ=-135](9.73249,0,5)%1
\end{pspicture}%
}
\def\octogon{%
    \begin{pspicture}(-2.2,-2.2)(2.2,2.2)
    \Table
    \pNodeThreeD(12.07,5,0){A1}%
    \pNodeThreeD(5,12.07,0){A2}%
    \pNodeThreeD(-5,12.07,0){A3}%
    \pNodeThreeD(-12.07,5,0){A4}%
    \pNodeThreeD(-12.07,-5,0){A5}%
    \pNodeThreeD(-5,-12.071,0){A6}%
    \pNodeThreeD(5,-12.07,0){A7}%
    \pNodeThreeD(12.07,-5,0){A8}%
    \psclip{\pspolygon[fillstyle=solid,fillcolor=GrisClair,%
        linestyle=none](A1)(A2)(A3)(A4)(A5)(A6)(A7)(A8)}
        \DessusTable
    \endpsclip%
    \psset{A=5,B=5,C=5}
    \CubeThreeD(-17.07,0,5)%5
    \CubeThreeD[RotZ=45](-12.07,-12.07,5)%6
    \CubeThreeD[RotZ=90](0,-17.07,5)%7
    \CubeThreeD[RotZ=135](12.07,-12.07,5)%8
    \CubeThreeD[RotZ=-45](-12.07,12.07,5)%4
    \CubeThreeD[RotZ=-90](0,17.07,5)%3
    \CubeThreeD[RotZ=-135](12.07,12.07,5)%2
    \CubeThreeD[RotZ=180](17.07,0,5)%1
\end{pspicture}%
}
%
\def\starhexadecagon{%
    \begin{pspicture}(-2.2,-2)(2.2,2.2)
    \Table
    \pNodeThreeD(17.07,7.07,0){A1}%
    \pNodeThreeD(7.07,17.07,0){A2}%
    \pNodeThreeD(-7.07,17.07,0){A3}%
    \pNodeThreeD(-17.07,7.07,0){A4}%
    \pNodeThreeD(-17.07,-7.07,0){A5}%
    \pNodeThreeD(-7.07,-17.07,0){A6}%
    \pNodeThreeD(7.07,-17.07,0){A7}%
    \pNodeThreeD(17.07,-7.07,0){A8}%
    \psclip{\pspolygon[fillstyle=solid,fillcolor=GrisClair,%
        linestyle=none](A1)(A2)(A3)(A4)(A5)(A6)(A7)(A8)}
        \DessusTable
    \endpsclip%
    \psset{A=5,B=5,C=5}
    \CubeThreeD[RotZ=225](-17.07,0,5)%5
    \CubeThreeD[RotZ=-90](-12.07,-12.07,5)%6
    \CubeThreeD[RotZ=-45](0,-17.07,5)%7
    \CubeThreeD(12.07,-12.07,5)%8
    \CubeThreeD[RotZ=180](-12.07,12.07,5)%4
    \CubeThreeD[RotZ=135](0,17.07,5)%3
    \CubeThreeD[RotZ=90](12.07,12.07,5)%2
    \CubeThreeD[RotZ=45](17.07,0,5)%1
\end{pspicture}}
%
\def\DecorSable{%
  \FrameThreeD[normaleLongitude=0,normaleLatitude=90,%
     fillstyle=solid,fillcolor=GrayE](0,0,0)(-60,-60)(60,60)
  \QuadrillageThreeD[normaleLongitude=0,normaleLatitude=90,%
     linecolor=GrayA,linewidth=0.2mm,grille=10](0,0,0)(-60,-60)(60,60)%
}
\newpsstyle{GradGrayWhite}{fillstyle=gradient,%
    gradbegin=blue,gradend=white,linewidth=0.1mm}%

\begin{document}

\title{3D views with \texttt{pst-vue3d}\\[3ex]
 \normalsize (v. \VueFversion)}
\author{Manuel Luque\thanks{\url{mluque5130 _at_ aol.com}}\ 
and Herbert Vo\ss\thanks{\url{voss _at_ pstricks.de}}}

\maketitle
\tableofcontents
\clearpage

\section{Presentation}
The 3D representation of an object or a landscape is one of the
most interesting subject in computer science and have many
industrial applications (car and plane design, video game
etc\ldots). In a smaller way, one can obtain very didactic
realizations using PSTricks with two peculiarities:
\begin{itemize}
  \item using PostScript;
  \item being manageable through \LaTeX.
\end{itemize}
Package \texttt{pst-key} of David \textsc{Carlisle} allows to
write commands with parameters. Using this as an interface, one
can observe the result of little modifications of some parameters.
Our parameters being here: the position of the watcher, the choice
of an solid (cube, sphere etc\ldots) and many other things. I want
to signal that
\begin{itemize}
\item
Regarding 3D representation, one does not forget the package pst-3d by Timothy Van Zandt
who has used the best part of Post\-Script. Althrought limited to parallel projections,
this package allows to draw very interesting 3D figure.\footnote{A lot of different examples
for 3D images are available at: \url{http://members.aol.com/Mluque5130/}}
\item Thanks to Denis \textsc{Girou}, i have discovered the
package \texttt{pst-xkey} and I have learned it.
\item I have written another package for drawing picture reflecting
in  spherical mirrors.%
\footnote{\url{http://melusine.eu.org/syracuse/mluque/BouleMiroir/boulemiroir.html}}

It is a french paper which illustrate a study of Pr. Henri
\textsc{Bouasse} from this book \textit{Optique sup\'erieure}, edited in $1917$ by  Delagrave.
\end{itemize}


\section{Aims}
First, we want to draw the 3D representation with elimination of
the hidden parts of some objects.

The position of  the watcher will be defined by its spherical
coordinates: the distances from the origin, the longitude $\theta$
and the latitude $\phi$. We will choose, too, the distance of the
projection screen from this point.

Second, we want to define some $3D$ elements of the scene: the bricks.

The following bricks are already defined
\begin{itemize}
\item A box given by its three dimensions \verb+A,B,C+: it could
be turn into a cube or a dice.
\item A point which can be defined it two ways
\begin{itemize}
\item By cartesian coordinates $(x,y,z)$
\item Or by  spherical coordinates $(R,\theta,\phi)$
 ($\theta$, $\phi$ are, respectively, longitude and latitude).
\end{itemize}
\item A rectangle.
\item A circle defined by the normal line to its plane, its center
and its radius. An arc is defined as the circle with two limit
angles.
\item A tetrahedron given by the coordinates of the center of its
base and the radius of the circle containing the vertex of each
faces.  We can make it rotate.
\item A square pyramid given by the half of the length of the side
of its base and its height. We can make it rotate and move.
\item A sphere given by the coordinates of its center \verb+\SphereThreeD(x,y,z){Radius}+
and its radius. We can make it rotate with the parameters
\verb+RotX=...+, \verb+RotY=...+, \verb+RotZ=...+ We can choose to
draw only some meridians and parallel circles.
 \item A  solid or empty half-sphere (same parameters than a sphere)
 \item A vertical cylinder defined by its radius and its height. We
 can make it rotate using the parameters \verb+RotX=...+, \verb+RotY=...+, \verb+RotZ=...+
 An we can choose the center of its base in the same way than the Sphere.
\item A cone and a truncated cone defined by the radius of their
base, the height and the height of the truncature.
\end{itemize}

\vspace*{1cm}
To construct a scene, one may choose himself the order of the
objects. For example, if an object 1 is partially hidden by an
object 2, we write, in the list of commands, first object 1 and
second object 2.

\section{Rotating in the 3D space}

A 3D object can be rotated around every axes with the \verb+RotX+, \verb+RotY+ and
\verb+RotZ+ option. They can be mixed in every combination. Figure~\ref{fig:rot} shows
how a rotation around the z-axes works.

\begin{figure}[!htb]
\multido{\iRotZ=0+45}{8}{%
  \begin{pspicture}(-1.5,-1.5)(1.5,1.5)
    \psset{THETA=70,PHI=30,Dobs=200,Decran=10}
    \psset{A=5,B=5,C=A,fillstyle=solid,fillcolor=GrisClair,%
       linecolor=red, RotZ=\iRotZ}
    \tapis\DieThreeD(0,0,0)%
    \LineThreeD[linecolor=red,linestyle=dashed,arrows=->](0,0,0)(0,0,25)
    \pNodeThreeD(0,0,12.5){Z'}
    \uput[180](Z'){\texttt{RotZ=\iRotZ}}
  \end{pspicture}\hfill %
}

\psset{THETA=-10,PHI=20,Dobs=200,Decran=10}
\multido{\iCX=0+30}{8}{%
  \begin{pspicture}(-1.5,-1.5)(1.5,1.5)
    \AxesThreeD{->}(50,20,20)
    \psset{A=20,B=5,C=10,fillstyle=solid,fillcolor=LightBlue,linecolor=gray}
    \psset{RotZ=0,RotY=0,RotX=\iCX}
    \CubeThreeD(0,0,0)%
    \psset{linestyle=dashed}
  \end{pspicture}\hfill%
}%
\caption{Diffenerent views of a die and a cube\label{fig:rot}}
\end{figure}


\section{Location of the cube in the space}
Suppose that one wants to place a 10-units edge cube at the point
$(x=40,y=40,z=35)$. First, the half edge of the cube will be
define by the parameters : \verb+A=5,B=5,C=5+, and next the
coordinates of its center by \texttt{(40,40,35)}. On the
figure, the period of the grid is 10~units
(figure~\ref{coordinates}).

\begin{figure}[!htb]
\centering
\begin{LTXexample}[width=0.45\linewidth]
\psset{THETA=30,PHI=30,Dobs=200,Decran=12}
\begin{pspicture}(-2.8,-3)(3.5,3.5)
    \PlansOXYZ
    \pNodeThreeD(40,40,35){G}
    \pNodeThreeD(40,40,0){G_XY}
    \pNodeThreeD(40,0,0){G_X}
    \pNodeThreeD(0,40,0){G_Y}
    \pNodeThreeD(0,0,35){G_Z}
    \pNodeThreeD(0,40,35){G_YZ}
    \pNodeThreeD(40,0,35){G_XZ}
    \psdots(G)(G_XY)(G_XZ)(G_YZ)(G_X)(G_Y)(G_Z)
    \psline(G)(G_XY)
    \psline(G)(G_XZ)
    \psline(G)(G_YZ)
    \psline(G_Z)(G_XZ)
    \psline(G_Z)(G_YZ)
    \AxesThreeD{->}(55)
\end{pspicture}
\end{LTXexample}
\caption{\label{coordinates}Origin \texttt{(40,40,35)}}
\end{figure}

\begin{figure}[!ht]
\centering
\begin{LTXexample}[width=0.45\linewidth]
\psset{THETA=30,PHI=30,Dobs=200,Decran=12}
\begin{pspicture}(-2.8,-3)(3.5,3.5)
  \PlansOXYZ
  \pNodeThreeD(40,40,35){G}
  \pNodeThreeD(40,40,0){G_XY}
  \pNodeThreeD(40,0,0){G_X}
  \pNodeThreeD(0,40,0){G_Y}
  \pNodeThreeD(0,0,35){G_Z}
  \pNodeThreeD(0,40,35){G_YZ}
  \pNodeThreeD(40,0,35){G_XZ}
  \psdots(G)(G_XY)(G_XZ)(G_YZ)(G_X)(G_Y)(G_Z)
  \psline(G)(G_XY)
  \psline(G)(G_XZ)
  \psline(G)(G_YZ)
  \psline(G_Z)(G_XZ)
  \psline(G_Z)(G_YZ)
  \psset{A=5,B=5,C=5}
  \DieThreeD(40,40,35)%
  \AxesThreeD{->}(55)
\end{pspicture}
\end{LTXexample} 
\caption{\label{CubeOne}The placed cube.}
\end{figure}


To make it rotate of  around  $OX$ , one adds the parameter \verb+RotX=90+(figure~\ref{RotX}).

\begin{figure}[!ht]
\begin{LTXexample}[width=0.45\linewidth]
\psset{THETA=30,PHI=30,Dobs=200,Decran=12}
\begin{pspicture}(-2.8,-3)(3.5,3.5)
  \PlansOXYZ
  \AxesThreeD{->}(55)
  \psset{A=5,B=5,C=5,RotX=90}
  % projections sur les plaans
  \DieThreeD(40,40,5)%
  \DieThreeD(5,40,35)%
  \DieThreeD(40,5,35)%
  \pNodeThreeD(40,40,35){G}
  \pNodeThreeD(40,40,10){G_XY}
  \pNodeThreeD(10,40,35){G_YZ}
  \pNodeThreeD(40,10,35){G_XZ}
  \psline(G)(G_XY)
  \psline(G)(G_XZ)
  \psline(G)(G_YZ)
  \DieThreeD(40,40,35)%
\end{pspicture}
\end{LTXexample}
\caption{\label{RotX} 90\textsuperscript{o} rotation around $OX$ and plane projections.}
\end{figure}


Three successive rotations around three axes with: \verb+RotX=60,RotY=20,RotZ=110+, are illustrate in figure~\ref{RotXYZ}.

\begin{figure}[!ht]
\begin{LTXexample}[width=0.45\linewidth]
\psset{THETA=30,PHI=30,Dobs=200,Decran=12}
\begin{pspicture}(-2.8,-3)(3.5,3.5)
  \PlansOXYZ
  \AxesThreeD(55)
  \DieThreeD[A=5,B=5,C=5,RotX=30,RotY=20,RotZ=150](40,40,35)%
\end{pspicture}
\end{LTXexample}
\caption{\label{RotXYZ}rotations around $OX$, $OY$ et $OZ$: \texttt{RotX=60,RotY=20,RotZ=110}.}
\end{figure}

\section{Constructions using cubes}
This section was done after a book first published in  1873 and
titled:

\begin{figure}[!ht]
\centering
\psframebox{%
\begin{pspicture}(-3.1,-3.8)(3.1,3)
\rput(0,2.6){M\'ETHODE INTUITIVE}
\rput(0,2){\Large EXERCICES ET TRAVAUX}
\rput(0,1.5){POUR LES ENFANTS}
\rput(0,1){\tiny SELON LA M\'ETHODE ET LES PROC\'ED\'ES}
\rput(0,0){de \textbf{PESTALOZZI et FR\OE{}BEL}}
\rput(0,-1){M\textsuperscript{me} FANNY DELON}
\rput(0,-1.5){\tiny Directrice d'une \'Ecole professionnelle \`a Paris}
\rput(0,-2){M. CH. DELON}
\rput(0,-2.5){\tiny Licenci\'e \`es sciences}
\rput(0,-3){PARIS}
\rput(0,-3.5){1873}
\end{pspicture}}
\end{figure}

for children at infant school! One can not be surprised that
theses kinds of pedagogue gave rise to the generation of Eintein,
Maxwell, Bohr etc.



\begin{figure}[ht]
\begin{LTXexample}[width=0.45\linewidth]
\psset{THETA=15,PHI=50,Dobs=200,Decran=15}
\hexagon
\end{LTXexample}
\caption{\label{hexagone}hexagon.}
\end{figure}

\begin{figure}[ht]
\begin{LTXexample}[width=0.45\linewidth]
\psset{THETA=15,PHI=50,Dobs=200,Decran=15}%
\stardodecagon
\end{LTXexample}
\caption{\label{dodecagone}star dodecagon.}
\end{figure}

\begin{figure}[ht]
\begin{LTXexample}[width=0.45\linewidth]
\psset{THETA=-15,PHI=50,Dobs=200,Decran=15}
\pentagon
\end{LTXexample}
\caption{\label{pentagone}pentagon.}
\end{figure}

\begin{figure}[ht]
\begin{LTXexample}[width=0.45\linewidth]
\psset{THETA=-15,Decran=10,Dobs=100,PHI=75}
\stardecagon
\end{LTXexample}
\caption{\label{decagone}star decagon.}
\end{figure}

\begin{figure}[ht]
\begin{LTXexample}[width=0.45\linewidth]
\psset{THETA=20,PHI=75,Decran=10,Dobs=100}
\begin{pspicture*}(-2.5,-2.5)(2.5,2)
\Table
\psset{A=5,B=5,C=5}
\CubeThreeD(-7.88675,0,5)%1
\CubeThreeD[RotZ=-120](3.94338,6.83,5)%2
\CubeThreeD[RotZ=120](3.94338,-6.83,5)%3
\end{pspicture*}
\end{LTXexample}
\caption{\label{triangle}triangle.}
\end{figure}


\begin{figure}[ht]
\begin{LTXexample}[width=0.45\linewidth]
\psset{THETA=-15,PHI=50,Decran=10,Dobs=150}
\octogon
\end{LTXexample}
\caption{\label{octogone}octogon.}
\end{figure}


\begin{figure}[ht]
\begin{LTXexample}[width=0.45\linewidth]
\psset{THETA=-15,Decran=10,Dobs=150,PHI=75}
\starhexadecagon
\end{LTXexample}
\caption{\label{hexadecagon}star hexadecagon.}
\end{figure}

\begin{figure}[ht]
\begin{LTXexample}[width=0.45\linewidth]
\psset{THETA=-15,Decran=10,Dobs=150,PHI=75}
\begin{pspicture}(-2.2,-1.75)(2.2,2.2)
  \Table
  \pNodeThreeD(-8.66,-5,0){A6}
  \pNodeThreeD(-8.66,5,0){A1}
  \pNodeThreeD(0,10,0){A2}
  \pNodeThreeD(8.66,5,0){A3}
  \pNodeThreeD(8.66,-5,0){A4}
  \pNodeThreeD(0,-10,0){A5}%
  \psclip{\pspolygon[fillstyle=solid,fillcolor=GrisClair,%
    linestyle=none](A1)(A2)(A3)(A4)(A5)(A6)}
    \DessusTable
  \endpsclip
  \psset{A=5,B=5,C=5}
  \DieThreeD[RotZ=60,RotX=-90](-6.83,-11.83,5)%
  \DieThreeD[RotZ=120,RotY=-90](6.83,-11.83,5)%
  \DieThreeD[RotX=90](-13.86,0,5)%
  \DieThreeD[RotZ=-60,RotY=90](-6.83,11.83,5)%
  \DieThreeD[RotZ=-120,RotY=180](6.83,11.83,5)%
  \DieThreeD[RotZ=180](13.86,0,5)%
\end{pspicture}
\end{LTXexample}
\caption{\label{pentagoneDie}hexagon with dices.}
\end{figure}

Observing figure from off :
\begin{verbatim}
\psset{PHI=90,THETA=0}
\end{verbatim}
 one obtains classical geometric
figures :

(\ref{hexagonePlan}) (\ref{dodecagonePlan}) (\ref{pentagonePlan}) (\ref{decagonePlanStar})
(\ref{trianglePlan}) (\ref{octogonePlan}) (\ref{hexadecagonePlan}) (\ref{hexagonePlanDie}).

\begin{figure}[ht]
\centering
\psset{THETA=0,Decran=10,Dobs=125,PHI=90}
\hexagon
\caption{\label{hexagonePlan}``flat'' hexagon.}
\end{figure}


\begin{figure}[ht]
\centering
\psset{Decran=10,Dobs=100}
\psset{PHI=90,THETA=0}
\stardecagon
\caption{\label{dodecagonePlan}``flat'' star dodecagone.}
\end{figure}
%
\begin{figure}[ht]
\centering
\psset{Decran=10,Dobs=125}
\psset{PHI=90,THETA=0}
\pentagon
\caption{\label{pentagonePlan}``flat'' pentagon.}
\end{figure}


\begin{figure}[ht]
\centering
\psset{THETA=0,Decran=10,Dobs=125,PHI=90}
\stardecagon
\caption{\label{decagonePlanStar}``flat'' star decagon.}
\end{figure}
%


%
\begin{figure}[ht]
\centering
\psset{PHI=90,THETA=0,Decran=10,Dobs=100}
\begin{pspicture}*(-2.2,-2.2)(2.2,2.2)
\Table
\psset{A=5,B=5,C=5}
\CubeThreeD(-7.88675,0,5)%1
\CubeThreeD[RotZ=-120](3.94338,6.83,5)%2
\CubeThreeD[RotZ=120](3.94338,-6.83,5)%3
\end{pspicture}
\caption{\label{trianglePlan}``flat'' triangle.}
\end{figure}


\begin{figure}[ht]
\centering
\psset{PHI=90,THETA=0,Decran=10,Dobs=125}
\octogon
\caption{\label{octogonePlan}``flat'' octogon.}
\end{figure}



\begin{figure}[ht]
\centering
\psset{PHI=90,THETA=0,Decran=10,Dobs=125}
\starhexadecagon
\caption{\label{hexadecagonePlan}``flat'' star hexadecagon.}
\end{figure}

\begin{figure}[ht]
\centering
\psset{PHI=90,THETA=0,Decran=10,Dobs=125}
\begin{pspicture}(-2.2,-2.2)(2.2,2.2)
\Table
\pNodeThreeD(-8.66,-5,0){A6}
\pNodeThreeD(-8.66,5,0){A1}
\pNodeThreeD(0,10,0){A2}
\pNodeThreeD(8.66,5,0){A3}
\pNodeThreeD(8.66,-5,0){A4}
\pNodeThreeD(0,-10,0){A5}%
\psclip{\pspolygon[fillstyle=solid,fillcolor=GrisClair,linestyle=none](A1)(A2)(A3)(A4)(A5)(A6)}
\DessusTable
\endpsclip
\psset{A=5,B=5,C=5}
\DieThreeD[RotZ=60,RotX=-90](-6.83,-11.83,5)%
\DieThreeD[RotZ=120,RotY=-90](6.83,-11.83,5)%
\DieThreeD[RotX=90](-13.86,0,5)%
\DieThreeD[RotZ=-60,RotY=90](-6.83,11.83,5)%
\DieThreeD[RotZ=-120,RotY=180](6.83,11.83,5)%
\DieThreeD[RotZ=180](13.86,0,5)%
\end{pspicture}
\caption{\label{hexagonePlanDie}``flat'' hexagon with dices.}
\end{figure}




\clearpage


\section{Sphere, part of sphere, half-sphere, parallels and meridians}

Beside \verb+sphereThreeD+ there exist several macro for spheres:

\begin{itemize}
\item \verb|SphereInverseThreeD|
\item \verb|\SphereCercleThreeD|
\item \verb|\SphereMeridienThreeD|
\item \verb|\DemiSphereThreeDThreeD|
\item \verb|\SphereCreuseThreeD|
\item \verb|\PortionSphereThreeD|
\end{itemize}


The macro:
\begin{verbatim}
\SphereThreeD(10,30,20){20}
\end{verbatim}
draws the sphere defined by the coordinates of its centre and its radius which is shown in
figure~\ref{sphere} together with the macro
\begin{verbatim}
\PortionSphereThreeD(0,0,0){20}
\end{verbatim}
and some more additional lines.

\begin{verbatim}
\begin{pspicture}(-3,-3.5)(3,5)
\psset{THETA=30,PHI=30,Dobs=100,Decran=10}
{\psset{style=GradGrayWhite}%
\SphereThreeD(0,0,0){20}
\psset{fillstyle=solid,fillcolor=gray}
\PortionSphereThreeD(0,0,0){20}
\pNodeThreeD(20;10;10){C1}
\pNodeThreeD(40;10;10){D1}
\psline(C1)(D1)
\pNodeThreeD(20;10;-10){C2}
\pNodeThreeD(40;10;-10){D2}
\psline(C2)(D2)
\pNodeThreeD(20;-10;-10){C3}
\pNodeThreeD(40;-10;-10){D3}
\psline(C3)(D3)
\pNodeThreeD(20;-10;10){C4}
\pNodeThreeD(40;-10;10){D4}
\psline(C4)(D4)
\PortionSphereThreeD%
	[style=GradGrayWhite](0,0,0){40}}
% PhiCercle=latitude of the cercle
% \SphereCercle[PhiCercle=...]{radius}
\psset{linecolor=white,PhiCercle=45}
\SphereCercleThreeD(0,0,0){20}
% ThetaMeridien=longitude of the meridian
% \SphereMeridien[ThetaMeridien=...]{radius}
\SphereMeridienThreeD%
	[ThetaMeridien=45](0,0,0){20}
\pNodeThreeD(20;45;45){A}
\pNodeThreeD(50;45;45){B}
\psline[linecolor=black]{->}(A)(B)
\pNodeThreeD(20;0;90){Nord}
\pNodeThreeD(40;0;90){Nord1}
\psline[linecolor=black]{->}(Nord)(Nord1)
\SphereCercleThreeD[PhiCercle=0](0,0,0){20}
\SphereMeridienThreeD%
	[ThetaMeridien=0](0,0,0){20}
\end{pspicture}
\end{verbatim}



\begin{figure}[!htb]
\begin{pspicture}(-3,-3.5)(3,5)
\psset{THETA=30,PHI=30,Dobs=100,Decran=10}
\bgroup
  \psset{style=GradGrayWhite}%
  \SphereThreeD(0,0,0){20}
  \psset{fillstyle=solid,fillcolor=gray}
  \PortionSphereThreeD(0,0,0){20}
  \pNodeThreeD(20;10;10){C1}
  \pNodeThreeD(40;10;10){D1}
  \psline(C1)(D1)
  \pNodeThreeD(20;10;-10){C2}
  \pNodeThreeD(40;10;-10){D2}
  \psline(C2)(D2)
  \pNodeThreeD(20;-10;-10){C3}
  \pNodeThreeD(40;-10;-10){D3}
  \psline(C3)(D3)
  \pNodeThreeD(20;-10;10){C4}
  \pNodeThreeD(40;-10;10){D4}
  \psline(C4)(D4)
  \PortionSphereThreeD[style=GradGrayWhite](0,0,0){40}
\egroup
% PhiCercle=latitude of the cercle
% \SphereCercle[PhiCercle=...]{radius}
  \psset{linecolor=white,PhiCercle=45}
  \SphereCercleThreeD(0,0,0){20}
% ThetaMeridien=longitude of the meridian
% \SphereMeridien[ThetaMeridien=...]{radius}
  \SphereMeridienThreeD[ThetaMeridien=45](0,0,0){20}
% \pNodeThreeD(radius}{longitude}{latitude}{name of the point}
  \pNodeThreeD(20;45;45){A}
  \pNodeThreeD(50;45;45){B}
  \psline[linecolor=black]{->}(A)(B)
  \pNodeThreeD(20;0;90){Nord}
  \pNodeThreeD(40;0;90){Nord1}
  \psline[linecolor=black]{->}(Nord)(Nord1)
  \SphereCercleThreeD[PhiCercle=0](0,0,0){20}
  \SphereMeridienThreeD[ThetaMeridien=0](0,0,0){20}
\end{pspicture}
\caption{\label{sphere}A Sphere.}
\end{figure}


\begin{figure}[!htb]
\centering
\begin{pspicture}(-3,-2)(3,5)
  \psset{THETA=60,PHI=30,Dobs=100,Decran=10}
% \DemiSphereThreeD(x,y,z){radius}
  \DemiSphereThreeD[RotX=180,style=GradGrayWhite](0,0,0){20}
  \SphereCreuseThreeD[RotX=180,linecolor=white,style=GradGrayWhite](0,0,0){20}
  \AxesThreeD[linestyle=dashed](30,30,40)
\end{pspicture}
\caption{\label{halfsphere}half-sphere.}
\end{figure}


\begin{figure}[!htb]
\centering
\begin{pspicture}(-3,-2)(3,2)
\psset{THETA=60,PHI=20,Dobs=100,Decran=10}
\psset{style=GradGrayWhite}%
\SphereThreeD(0,0,0){10}%
\DemiSphereThreeD[RotX=180](0,0,0){20}%
\begin{psclip}{%
\SphereCreuseThreeD[RotX=180,linecolor=white](0,0,0){20}}%
\SphereThreeD(0,0,0){10}
\end{psclip}%
\end{pspicture}
\caption{\label{egg} levitation}
\end{figure}


\section{A Hole in a sphere}

\begin{figure}[!htb]
\centering
\psset{THETA=10,PHI=30,Dobs=100,Decran=10}
\begin{pspicture}*(-3,-3)(3,3)
  \SphereThreeD[style=GradGrayWhite,gradmidpoint=0.2](0,0,0){40}%
  \begin{psclip}{\PortionSphereThreeD[PortionSpherePHI=40,%
       DeltaPHI=30,DeltaTHETA=30,linewidth=4\pslinewidth](0,0,0){40}}%
    \SphereInverseThreeD[style=GradGrayWhite](0,0,0){40}%
    \SphereThreeD[style=GradGrayWhite](0,0,0){30}%
    \begin{psclip}{\PortionSphereThreeD[PortionSpherePHI=30,%
         DeltaPHI=30,DeltaTHETA=30,linewidth=4\pslinewidth](0,0,0){30}}%
      \SphereInverseThreeD[style=GradGrayWhite](0,0,0){30}%
      \SphereThreeD[style=GradGrayWhite](0,0,0){20}%
      \begin{psclip}{\PortionSphereThreeD[PortionSpherePHI=30,%
           DeltaPHI=30,DeltaTHETA=30,linewidth=4\pslinewidth](0,0,0){20}}%
        \SphereInverseThreeD[style=GradGrayWhite](0,0,0){20}%
        \SphereThreeD[style=GradGrayWhite](0,0,0){10}%
        \begin{psclip}{%
          \PortionSphereThreeD[PortionSpherePHI=30,%
              DeltaPHI=30,DeltaTHETA=30,linewidth=4\pslinewidth](0,0,0){10}}%
          \SphereInverseThreeD[style=GradGrayWhite](0,0,0){10}%
          \SphereThreeD[style=GradGrayWhite](0,0,0){5}%
        \end{psclip}%
      \end{psclip}%
    \end{psclip}%
  \end{psclip}%
\end{pspicture}
\caption{\label{Holeinasphere}A Hole in a sphere.}
\end{figure}

It is a rectangular hole whose the size are meridian and parallels
arcs (figure~\ref{Holeinasphere}).

We  define the part of the sphere setting its radius, the center
of the sphere and the $\Delta\phi$ and $\Delta\theta$.
\begin{verbatim}
\PortionSphereThreeD[PortionSpherePHI=45,%
              PortionSphereTHETA=0,%
                       DeltaPHI=45,%
                 DeltaTHETA=20](0,0,0){20}
\end{verbatim}

There are the parameters of the first hole. The radius is
\texttt{20}.
\begin{verbatim}
{\psset{fillstyle=gradient,%
           gradbegin=white,%
              gradend=blue,%
          gradmidpoint=0.2,%
            linecolor=cyan,%
            linewidth=0.1mm}
\SphereThreeD(0,0,0){20}}%
\begin{psclip}{%
\PortionSphereThreeD[PortionSpherePHI=45,%
    DeltaPHI=45,DeltaTHETA=20](0,0,0){20}}
\SphereInverseThreeD[fillstyle=solid,%
                 fillcolor=red,%
                linecolor=blue](0,0,0){20}%
\end{psclip}%
\end{verbatim}

This is the tricks to see the inner of the sphere.

\verb+\SphereInverse+ define the hidden part of the sphere.


\section{Drawing a cylinder}
A cylinder is defined by the radius of its base and its height.
The center of the base is set in the usual way, and
\textsf{RotX,RotY,RotZ} make it rotate around the axes.

\verb+\CylindreThreeD(x,y,z){radius}{hauteur}+

\begin{figure}[!htb]
\centering
\begin{pspicture}(-3.5,-2)(3,4.5)
\psset{THETA=5,PHI=40,Dobs=150,Decran=6.5,fillstyle=solid,linewidth=0.1mm}
% plan horizontal
{\psset{normaleLongitude=0, normaleLatitude=90}
\FrameThreeD[fillstyle=solid,fillcolor=GrisClair](0,0,0)(-50,0)(50,50)
\FrameThreeD[fillstyle=solid,fillcolor=GrisClair](0,0,0)(-50,0)(50,-50)
\QuadrillageThreeD(0,0,0)(-50,-50)(50,50)}
\multido{\iCY=-45+90}{2}{%
    \CylindreThreeD(-45,\iCY,0){5}{50}
    \DemiSphereThreeD(-45,\iCY,50){5}%
}
\CylindreThreeD(0,0,0){10}{15}
\CylindreThreeD(0,0,15){20}{5}
\DemiSphereThreeD[RotX=180](0,0,35){20}
\SphereCreuseThreeD[RotX=180](0,0,35){20}
{\psset{RotY=90,RotX=0,RotZ=30}
\CylindreThreeD(15,15,5){5}{20}}
\multido{\iCY=-45+90}{2}{%
\CylindreThreeD(45,\iCY,0){5}{50}
\DemiSphereThreeD(45,\iCY,50){5}}
\end{pspicture}
\caption{\label{cylinder}cylinders.}
\end{figure}

\begin{verbatim}
\CylindreThreeD(0,0,-5){10}{15}}
\psset{RotY=90}
\CylindreThreeD(15,15,-5){5}{20}
\end{verbatim}


\section{Tetrahedron, cone and square pyramid}
\subsection{square pyramid}
\begin{verbatim}
\psset{A=...,Hpyramide=...}
\Pyramide
\end{verbatim}

See the examples of figures~(\ref{Pyramid})~(\ref{Obelisque}).

\begin{figure}[!htb]
\centering
\psset{ColorFaceD=GrayD,ColorFaceA=GrayA,%
    ColorFaceB=GrayB,ColorFaceC=GrayC,ColorFaceE=GrayE}
\psframebox[fillstyle=solid,fillcolor=GrayB,framesep=0pt]{%
\begin{pspicture}*(-3,-4)(3,4)
\psset{THETA=-70,PHI=60,Dobs=200,Decran=15}
\DecorSable
\psset{RotZ=45,fillstyle=solid,linecolor=black,A=9}
\PyramideThreeD(5,35,0){10}
\psset{A=10}
\PyramideThreeD(0,0,0){13}
\psset{A=7}
\PyramideThreeD(10,-35,0){8.7}
\end{pspicture}}
\caption{\label{Pyramid}Pyramids of Egypt.}
\end{figure}


\begin{figure}[!htb]
\centering
\psframebox[fillstyle=solid,fillcolor=GrayB,framesep=0pt]{%
    \begin{pspicture}*(-2.5,-2)(2.5,5.5)
    \psset{THETA=30,PHI=30,Dobs=400,Decran=12}
    \DecorSable
    \CubeThreeD[A=15,B=15,C=15](0,0,15)%
    \psset{A=10,fillstyle=solid}
    \PyramideThreeD[fracHeight=0.8](0,0,30){150}%
    \psset{A=2}
    \PyramideThreeD(0,0,150){5}%
    \end{pspicture}%
}
\caption{\label{Obelisque}Obelisk of Egypt.}
\end{figure}


\subsection{Cone}
\begin{verbatim}
\ConeThreeD[fracHeight=...]
           (x,y,z){radius}{Height}
\end{verbatim}
by default \verb+fracHeight=1+ : figure~\ref{Cone}.

\begin{figure}[!htb]
\centering
\psframebox[fillstyle=solid,fillcolor=GrayB,framesep=0pt]{%
\begin{pspicture}*(-3,-5)(3,4)
\psset{THETA=30,PHI=40,Dobs=200,Decran=12,fillstyle=solid,%
    fillcolor=GrisClair,linewidth=0.25\pslinewidth}
\DecorSable
\CylindreThreeD(0,0,0){10}{50}
\ConeThreeD[fillcolor=GrayB](0,0,50){10}{10}
\CylindreThreeD[RotY=90,RotZ=150](40,20,10){10}{50}
\ConeThreeD[fracHeight=0.5](20,-20,0){10}{10}
\CylindreThreeD(20,-20,5){5}{50}
\ConeThreeD[fracHeight=0.5](50,50,0){10}{10}
\CylindreThreeD(50,50,5){5}{50}
\end{pspicture}}
\caption{\label{Cone}Cones and cylinders.}
\end{figure}

\section{Points and lines}
The command allowing to mark points and thus to draw lines
and polygons can be used of two manners, either with the Cartesian coordinates
 \begin{verbatim}
\pNodeThreeD(x,y,z){name}
\end{verbatim}
 or with the spherical coordinates :
\begin{verbatim}
\pNodeThreeD(radius;longitude;latitude)%
            {name of the point}
\end{verbatim}

For example \verb+\pNodeThreeD(25,-25,25){A}+, the point $A(25,25,25)$ places.
Points being positioned, just to write \verb+\psline(A)(B)+, to draw the segment $AB$.

 On the figure~\ref {points}, one drew a cube with its diagonals.
\begin{figure}[!htb]
\centering
\psset{unit=1cm}
 \psset{THETA=70,PHI=30,Dobs=150,Decran=10}
 \begin{pspicture}(-3,-3)(3,4)
  \AxesThreeD[linecolor=red,linestyle=dashed](50,60,50)
  \pNodeThreeD(25,-25,25){A}
  \pNodeThreeD(25,25,25){B}
  \pNodeThreeD(25,25,-25){C}
  \pNodeThreeD(25,-25,-25){D}
  \pNodeThreeD(-25,-25,25){E}
  \pNodeThreeD(-25,25,25){F}
  \pNodeThreeD(-25,25,-25){G}
  \pNodeThreeD(-25,-25,-25){H}
  \pspolygon(A)(B)(C)(D)
  \pspolygon(E)(F)(G)(H)
  \psline(A)(E)
  \psline(B)(F)
  \psline(C)(G)
  \psline(D)(H)
  \psset{linestyle=dashed}
  \psline(A)(G)
  \psline(B)(H)
  \psline(C)(E)
  \psline(D)(F)
% routine page 49 in "présentation de PSTricks"
% D.Girou "cahier 16 Gutengerg"
    \newcounter{lettre}
    \multido{\i=1+1}{8}{%
        \setcounter{lettre}{\i}
        \psdot[linecolor=red](\Alph{lettre})
        \uput[90](\Alph{lettre}){\Alph{lettre}}
    }
\end{pspicture}
\caption{\label{points}Points and lines.}
\end{figure}


\section{Circles}
A circle is defined by a vector normal for its plan by  $(\theta,\varphi)$, with the following parameters for example:
\begin{verbatim}
normaleLongitude=60,normaleLatitude=90
\end{verbatim}
The coordinates of his centre as well as his radius.
\begin{verbatim}
\CircleThreeD(x,y,z){radius}
\end{verbatim}

The circles of the figure~\ref{circles}, were drawn with the following
commands:

\begin{figure}[!htb]
\centering
\psframebox{%
    \begin{pspicture}(-2.5,-3.5)(3.5,1.5)
    \psset{THETA=50,PHI=50,Dobs=250,Decran=10}
    \multido{\iX=-70+10}{15}{%
        \pNodeThreeD(\iX,0,0){X1}
        \pNodeThreeD(\iX,50,0){X2}
        \psline(X1)(X2)
    }
    \multido{\iY=0+10}{6}{%
        \pNodeThreeD(-70,\iY,0){Y1}
        \pNodeThreeD(70,\iY,0){Y2}
        \psline(Y1)(Y2)%
    }
    \psset{normaleLongitude=0,normaleLatitude=90}
    \multido{\iXorigine=-65+10}{14}{%
        \multido{\iYorigine=5+10}{5}{%
            \CircleThreeD[linecolor=red](\iXorigine,\iYorigine,0){5}%
        }%
    }
    \end{pspicture}%
}
\caption{\label{circles}circles.}
\end{figure}

\begin{verbatim}
\psset{normaleLongitude=0,%
        normaleLatitude=90}
\multido{\iXorigine=-65+10}{14}{%
    \multido{\iYorigine=5+10}{5}{%
        \CircleThreeD[linecolor=red]%
            (\iXorigine,\iYorigine,0){5}}}
\end{verbatim}

\section{The macros and the options}
\subsection{The colors of the cube, the pyramid and tetraedre}

The predefined colors for the different sides of a cube are
always set in the \verb+rgb+ mode :
\begin{verbatim}
CubeColorFaceOne=1 1 0,%
CubeColorFaceTwo=0.9 0.9 0,%
CubeColorFaceThree=0.8 0.8 0,%
CubeColorFaceFour=0.7 0.7 0,%
CubeColorFaceFive=0.65 0.65 0,%
CubeColorFaceSix=0.75 0.75 0
\end{verbatim}

The colors for the pyramid and the tetraedre are taken from the predefined ones:
\begin{verbatim}
ColorFaceD=cyan,
ColorFaceA=magenta,
ColorFaceB=red,
ColorFaceC=blue,
ColorFaceE=yellow
\end{verbatim}

They can be changed in the usual way with the \verb+\psset+ macro.


\subsection{Common parameters}
\verb+RotX=<value>, RotY=<value>, RotZ=<value>+

The predefined value is zero, means no rotation.

\subsection{Cube}
The following command places a parallelepiped with a length of $a=40$, $b=20$ and $c=10$ units
and it is placed with its center at the point $x=25$, $y=25$ and $z=25$

\begin{verbatim}
\CubeThreeD[A=20,B=10,C=5](25,25,25)
\end{verbatim}

\begin{figure}[!htb]
\centering
\begin{pspicture}(-3,-3)(3,3.5)
\psset{PHI=30,THETA=45,Dobs=200}
\PlansOXYZ\AxesThreeD(55)
\FrameThreeD[normaleLongitude=0,%
             normaleLatitude=90,%
             fillstyle=vlines,hatchsep=0.4mm](25,25,0)(-10,-15)(10,15)
\FrameThreeD[normaleLongitude=0,%
             normaleLatitude=0,%
             fillstyle=vlines,hatchsep=0.4mm](0,25,25)(-10,-5)(10,5)
\FrameThreeD[normaleLongitude=90,%
             normaleLatitude=0,%
             fillstyle=vlines,hatchsep=0.4mm](25,0,25)(-15,-5)(15,5)
\CubeThreeD[A=15,B=10,C=5](25,25,25)%
\end{pspicture}
\caption{\label{Prisme}Parallelepiped}
\end{figure}

In other words: the length of the sides is \verb+2A,2B,2C+ (see figure~\ref{Prisme}).

For rotations, let us consider the result of a rotation around one of the axes, while knowing that it is possible to combine them.  The corresponding rotation of projection on the horizontal level is obtained with the parameter: \verb+normaleLongitude=<degrees>+ (figure~\ref{PrismeRotZ}).

\begin{figure}[!htb]
\centering
\begin{pspicture}(-3,-3)(3,3.5)
\psset{PHI=30,THETA=45,Dobs=200,RotZ=60}
\PlansOXYZ\AxesThreeD(55)
% la projection sur le plan Oxy
\FrameThreeD[normaleLongitude=60,%
             normaleLatitude=90,%
             fillstyle=vlines,hatchsep=0.4mm](25,25,0)(-10,-15)(10,15)
\CubeThreeD[A=15,B=10,C=5](25,25,25)%
\end{pspicture}
\caption{\label{PrismeRotZ}The same parallelepiped rotated with \texttt{RotZ=60}.}
\end{figure}

There is no difference to a die, except that all sides have the same length.


\begin{figure}[!htb]
\centering
\begin{pspicture}(-3,-3)(3,3.5)
\psset{PHI=30,THETA=45,Dobs=200,RotZ=60,,RotX=90}
\PlansOXYZ\AxesThreeD(55)
% la projection sur le plan Oxy
\FrameThreeD[normaleLongitude=60,%
             normaleLatitude=90,%
             fillstyle=vlines,hatchsep=0.4mm](25,25,0)(-5,-15)(5,15)
\CubeThreeD[A=15,B=10,C=5](25,25,25)%
\end{pspicture}
\caption{\label{PrismeRotXRotZ}The same parallelepiped, rotated with the values \texttt{RotX=90,RotZ=60}}
\end{figure}


\subsection{Cylinder and circle}
In addition to the already quoted optional parameters the cylinder  requires the obligatory parameters:
\begin{verbatim}
\CylindreThreeD[...](x,y,z){radius}{height}
\end{verbatim}

Projection on the horizontal level is obtained with the following values:

\begin{verbatim}
\CircleThreeD[normaleLongitude=0,%
             normaleLatitude=90,%
             fillstyle=vlines,%
             hatchsep=0.4mm](30,30,0){10}
\end{verbatim}

The circle macro needs the following parameters:

\begin{verbatim}
\CircleThreeD[...](x,y,z){radius}
\end{verbatim}

Figure~\ref{CylindreDemo} shows an example of the above macros.

\begin{figure}[!ht]
\centering
\begin{pspicture}(-3,-3)(3,3.5)
\psset{PHI=30,THETA=45,Dobs=200}
\PlansOXYZ\AxesThreeD(55)
% la projection sur le plan Oxy
\CircleThreeD[normaleLongitude=0,%
             normaleLatitude=90,%
             fillstyle=vlines,%
             hatchsep=0.4mm](30,30,0){10}
\CylindreThreeD[fillstyle=solid,fillcolor=yellow,%
   linewidth=0.1mm](30,30,20){10}{30}%
\end{pspicture}
\caption{\label{CylindreDemo}A cylinder with a radius of $10$ units and a
    height of $50$ units
    with its base center at \texttt{(30,30,20)}.%
}
\end{figure}


\section{See the interior of a cube}
The following option makes it possible to visualize the interior of the box, the result is seen in the figure~\ref{Cube inside} :

\begin{verbatim}
\DieThreeD(0,0,0)%
\begin{psclip}{%
\FrameThreeD[normaleLongitude=0,%
             normaleLatitude=90]%
			 (0,0,10)(-10,-10)(10,10)}%
\DieThreeD[CubeInside=true](0,0,0)%
\end{psclip}%
\end{verbatim}

\begin{figure}
\centering
\begin{pspicture}(-2,-2)(2,3.5)
  \psset{A=10,B=10,C=10,PHI=60,THETA=-60}
  \DieThreeD(0,0,0)%
  \begin{psclip}{%
    \FrameThreeD[normaleLongitude=0,%
       normaleLatitude=90](0,0,10)(-10,-10)(10,10)}%
    \DieThreeD[CubeInside=true](0,0,0)%
  \end{psclip}%
  \FrameThreeD[normaleLongitude=0,%
    normaleLatitude=90,linewidth=1mm](0,0,10)(-10,-10)(10,10)%
\end{pspicture}
\caption{\label{Cube inside}An empty box.}
\end{figure}


\nocite{*}

\bibliographystyle{plain}
\bibliography{pst-vue3d-doc}

\end{document}