7 %%% Leif Kornstaedt <kornstae@ps.uni-sb.de>
10 %%% Leif Kornstaedt, 2000
13 %%% $Date: 2000/09/04 22:34:00 $ by $Author: kornstae $
17 { /y /x x x mulf y y mulf addf sqrt } /dist
19 0.2 0.2 0.3 point /black1
20 0.4 0.4 0.5 point /black2
21 0.7 0.7 0.5 point /white1
22 1.0 1.0 0.8 point /white2
31 { % rotational: stripes according to angle u
32 u 12.0 mulf floor 2 modi 1 eqi { col1 } { col2 } if
34 { % flat: rays according to angle from origin to (u, v)
35 u 0.5 subf /u v 0.5 subf /v
36 u u v dist apply divf /b
37 0.0 v lessf { b asin } { 360.0 b asin subf } if 180.0 addf 30.0 divf
38 floor 2 modi 1 eqi { col1 } { col2 } if
51 { % top, bottom: checkered
52 0 u 8.0 mulf floor v 8.0 mulf floor addi
55 { 0 } % front, left: striped black/white
56 { 1 } % back, right: striped white/black
58 } if 2 modi eqi { black1 } { white2 } if
60 } cube -0.5 -1.0 -0.5 translate 8.0 0.3 8.0 scale /board
67 col1 col2 figureSurface apply /surface
68 surface sphere 0.0 1.0 0.0 translate
69 surface cylinder union
70 surface sphere 0.0 2.3 0.0 translate difference
71 surface sphere 0.8 uscale 0.0 2.5 0.0 translate union
75 white1 white2 pawn apply /whitePawn
76 black1 black2 pawn apply /blackPawn
83 col1 col2 figureSurface apply /surface
84 col1 col1 figureSurface apply /surface1
85 col2 col2 figureSurface apply /surface2
87 surface cylinder 1.0 0.75 1.0 scale
89 surface cone 0.0 -1.0 0.0 translate 180.0 rotatez 90.0 rotatey
90 1.0 7.5 1.0 scale union
91 surface cylinder 1.0 2.8 1.0 scale intersect
93 surface cylinder 0.0 3.0 0.0 translate union
95 surface cylinder 0.7 4.0 0.7 scale
97 surface1 plane 90.0 rotatex
98 surface2 plane -90.0 rotatex 30.0 rotatey intersect rot rotatey
100 15.0 apex apply 75.0 apex apply union 135.0 apex apply union
101 195.0 apex apply union 255.0 apex apply union 315.0 apex apply union
102 surface cylinder intersect union
103 0.0 3.5 0.0 translate difference
107 white1 white2 tower apply /whiteTower
108 black1 black2 tower apply /blackTower
115 col1 col2 figureSurface apply /surface
117 surface cylinder 1.0 0.75 1.0 scale
119 surface cone 180.0 rotatez 30.0 rotatey 0.0 1.0 0.0 translate
121 surface plane 0.0 3.0 0.0 translate intersect union
123 surface cone 1.0 3.0 1.0 scale 0.0 -1.0 0.0 translate
124 surface cylinder 1.0 2.0 1.0 scale intersect 0.0 -1.5 0.0 translate /head
125 head 1.25 1.0 1.25 scale 0.0 0.5 0.0 translate -90.0 rotatex
126 0.0 3.2 0.0 translate difference
127 head 0.8 1.0 0.8 scale -90.0 rotatex 0.0 3.2 0.0 translate union
131 white1 white2 knight apply /whiteKnight
132 black1 black2 knight apply 180.0 rotatey /blackKnight
139 col1 col2 figureSurface apply /surface
141 surface cylinder 1.0 0.75 1.0 scale
143 surface cone 180.0 rotatez 30.0 rotatey 0.0 1.0 0.0 translate
145 surface plane 0.0 3.0 0.0 translate intersect union
147 surface sphere 0.9 uscale 0.0 3.15 0.0 translate difference
148 surface sphere 0.8 uscale 0.0 3.25 0.0 translate union
152 white1 white2 bishop apply /whiteBishop
153 black1 black2 bishop apply /blackBishop
160 col1 col2 figureSurface apply /surface
161 col1 col1 figureSurface apply /surface1
162 col2 col2 figureSurface apply /surface2
164 surface cylinder 1.0 0.75 1.0 scale
166 surface cone 180.0 rotatez 30.0 rotatey 0.0 1.0 0.0 translate
168 surface plane 0.0 4.0 0.0 translate intersect union
171 surface cylinder 1.0 2.0 1.0 scale
172 surface1 plane -90.0 phi subf rotatex
173 surface2 plane 90.0 phi addf rotatex intersect
174 -45.0 rotatez 1.0 0.0 0.0 translate /wedge
175 wedge wedge 60.0 rotatey union wedge 120.0 rotatey union
176 wedge 180.0 rotatey union wedge 240.0 rotatey union wedge 300.0 rotatey union
177 0.0 1.0 0.0 translate difference
178 0.6 0.25 0.6 scale 0.0 4.7 0.0 translate union
180 surface sphere 0.9 uscale 0.0 3.9 0.0 translate difference
181 surface sphere 0.8 uscale 0.0 4.0 0.0 translate union
185 white1 white2 queen apply /whiteQueen
186 black1 black2 queen apply /blackQueen
193 col1 col2 figureSurface apply /surface
194 col1 col1 figureSurface apply /surface1
195 col2 col2 figureSurface apply /surface2
197 surface cylinder 1.0 0.75 1.0 scale
199 surface cone 180.0 rotatez 30.0 rotatey 0.0 1.0 0.0 translate
201 surface plane 0.0 4.0 0.0 translate intersect union
204 surface cylinder 1.0 2.0 1.0 scale
205 surface1 plane -90.0 phi subf rotatex
206 surface2 plane 90.0 phi addf rotatex intersect
207 -45.0 rotatez 1.0 0.0 0.0 translate /wedge
208 wedge wedge 60.0 rotatey union wedge 120.0 rotatey union
209 wedge 180.0 rotatey union wedge 240.0 rotatey union wedge 300.0 rotatey union
210 0.0 1.0 0.0 translate difference 0.6 0.25 0.6 scale
212 surface2 cube 0.1 0.7 0.1 scale
213 surface2 cube 0.6 0.1 0.1 scale -0.25 0.35 0.0 translate union
214 -0.05 0.4 -0.05 translate union
215 0.0 4.7 0.0 translate union
217 surface sphere 0.9 uscale 0.0 3.9 0.0 translate difference
218 surface sphere 0.8 uscale 0.0 4.0 0.0 translate union
222 white1 white2 king apply /whiteKing
223 black1 black2 king apply /blackKing
230 whitePawn -3.5 0.0 -2.5 translate union
231 whitePawn -2.5 0.0 -2.5 translate union
232 whitePawn -1.5 0.0 -2.5 translate union
233 whitePawn -0.5 0.0 -2.5 translate union
234 whitePawn 0.5 0.0 -2.5 translate union
235 whitePawn 1.5 0.0 -2.5 translate union
236 whitePawn 2.5 0.0 -2.5 translate union
237 whitePawn 3.5 0.0 -2.5 translate union
238 whiteTower -3.5 0.0 -3.5 translate union
239 whiteTower 3.5 0.0 -3.5 translate union
240 whiteKnight -2.5 0.0 -3.5 translate union
241 whiteKnight 2.5 0.0 -3.5 translate union
242 whiteBishop -1.5 0.0 -3.5 translate union
243 whiteBishop 1.5 0.0 -3.5 translate union
244 whiteQueen -0.5 0.0 -3.5 translate union
245 whiteKing 0.5 0.0 -3.5 translate union
246 blackPawn -3.5 0.0 2.5 translate union
247 blackPawn -2.5 0.0 2.5 translate union
248 blackPawn -1.5 0.0 2.5 translate union
249 blackPawn -0.5 0.0 2.5 translate union
250 blackPawn 0.5 0.0 2.5 translate union
251 blackPawn 1.5 0.0 2.5 translate union
252 blackPawn 2.5 0.0 2.5 translate union
253 blackPawn 3.5 0.0 2.5 translate union
254 blackTower -3.5 0.0 3.5 translate union
255 blackTower 3.5 0.0 3.5 translate union
256 blackKnight -2.5 0.0 3.5 translate union
257 blackKnight 2.5 0.0 3.5 translate union
258 blackBishop -1.5 0.0 3.5 translate union
259 blackBishop 1.5 0.0 3.5 translate union
260 blackQueen -0.5 0.0 3.5 translate union
261 blackKing 0.5 0.0 3.5 translate union
262 30.0 rotatey -20.0 rotatex 0.4 uscale 0.3 0.0 3.0 translate
264 %whiteTower -70.0 rotatex 0.0 0.0 4.0 translate
269 1.0 1.0 1.0 point pointlight /l
271 0.33 0.33 0.33 point [ l ] scene 3 60.0 400 300 "chess.ppm" render