1 /** This file is part of Shapes.
3 ** Shapes is free software: you can redistribute it and/or modify
4 ** it under the terms of the GNU General Public License as published by
5 ** the Free Software Foundation, either version 3 of the License, or
8 ** Shapes is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ** GNU General Public License for more details.
13 ** You should have received a copy of the GNU General Public License
14 ** along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 ** Copyright 2008, 2014 Henrik Tidefelt
20 ##lookin ..Shapes..Geometry3D
24 @nonstroking:[gray a / 360°]
26 [Geometry3D..rotate angle:a dir:(0,0,1)] [] [Graphics..fill (0.5cm,~4cm,0cm)--(2.5cm,~4cm,0cm)--(1.5cm,5cm,0.5cm)--cycle]
31 @stroking:[gray a / 360°]
33 [Geometry3D..rotate angle:a dir:(0,0,1)] [] [Graphics..stroke (1.5cm,~4cm,0cm)--(1.5cm,5cm,0.5cm)]
36 •zbuf: Graphics3D..newZBuf
43 p: (3cm,0cm,0cm)--(7cm,0cm,2cm)
44 •zbuf << @nonstroking:[gray 0.7] | [Graphics..fill (8cm,~1cm,0cm)--(8cm,1cm,0cm)--(4cm,0cm,2cm)--cycle]
45 << @nonstroking:[gray 0.3] | [Graphics..stroke p]
46 << @nonstroking:[gray 0.3] | [shift (0.3cm,0cm,0cm)] [] [Graphics..stroke [p 2.5cm].p--p.end.p]
47 << @nonstroking:[gray 0.3] | [shift (0.6cm,0cm,0cm)] [] [Graphics..stroke p.begin.p--(p.end-1.8cm).p]
48 << @nonstroking:[gray 0.3] | [shift (0.9cm,0cm,0cm)] [] [Graphics..stroke [p 2.0cm].p--(p.end-1.8cm).p]
51 tf: [Geometry3D..rotate (1,0,0) 60°]
52 |**tf: [Geometry3D..affinetransform (0,4,7) (2,5,8) (3,6,9) (0cm,0cm,0cm)]