Fichier triangle.jps — Modifié le 6 Novembre 2009 à 09 h 44

triangle.pdf
Source
/pstrickactionR3 {} def
3 -2 4 SetCamPos
0 0 0 SetCamView
GetCamPos 2 2 2 addv3d setlightsrc
{bleu} setlight
.5 setlightintensity

/S [
   0 0 0
   4 0 0
   0 4 0
] def

/F [
   [0 1 2]
] def

.2 setlinewidth

/f {
3 dict begin
   /z exch def
   /y exch def
   /x exch def
%   x y x dup mul y dup mul add .25 mul
   x y
   x y mul
   3 x sub y sub mul
end
} def

%S F generesolid
%5 {dup triangulemaillage} repeat
% (go) writeofffile
%% solidgetsommets
%% () exch
%% aload pop boum
/saveatan {atan} bind def
/atan {
2 dict begin
   /y exch def
   /x exch def
   0 x eq 0 y eq and {
      0
   } {
      x y saveatan
   } ifelse
end
} def

0 3 0 3 [.2 dup] newgrille
[1 1 0 -3] solidplansepare
dup {f} solidtransform
%dup videsolid
%dup (rouge) (jaune) inoutputcolors
dup 0 solidrmface
dup (jaune) outputcolors
dup drawsolid**
%solidnumfaces