home *** CD-ROM | disk | FTP | other *** search
/ Mega A/V / mega_av.zip / mega_av / GRAPHUTL / POVSCN.ZIP / LEVEL3.ZIP / TOMB.POV < prev    next >
Text File  |  1992-07-03  |  13KB  |  648 lines

  1. // Persistence Of Vision raytracer version 1.0 sample file.
  2.  
  3. // By Drew Wells
  4.  
  5. // Title-"Tomb" 
  6. // a haunted tomb on a hill, gravestones, rusty fence, pumpkin patch. 
  7. // - Drew Wells cis 73767,1244 
  8. // 11/90 rev 7/92
  9. #include "shapes.inc"
  10. #include "colors.inc"
  11. #include "textures.inc"
  12. #include "stones.inc"
  13.  
  14. /* Camera */
  15. camera {
  16.    direction <0.0 0.0  1.5>
  17.    up  <0.0  1.0  0.0>
  18.    right <-1.333 0.0 0.0>
  19.    translate < -15.0  5.0  120.0>
  20.    look_at <10.0 12.0 55.0>
  21. }
  22. #declare TombTex = texture { Stone8 ambient .1 scale <0.5 0.5 0.5> }
  23. #declare HeadTex = texture { Stone3  }
  24. #declare ColTex  = texture { Stone13 phong .3 scale <.2 .2 .2>  }
  25. #declare Rust = texture { Stone1 }
  26.  
  27.  
  28. #declare Yellow_Clouds = texture {
  29. bozo
  30. turbulence 0.6
  31. colour_map {
  32.    [0.0 0.3   colour red 0.9 green 0.5  blue 0.3
  33.    colour red 0.6 green 0.4  blue 0.0]  
  34.    [0.3 0.6   colour red 0.6 green 0.4  blue 0.0
  35.    colour red 0.4 green 0.4  blue 0.0 alpha 1.0]  
  36.    [0.6 0.8   colour red 0.4 green 0.4  blue 0.0 alpha 1.0
  37.    colour Clear]  
  38.    [0.8 1.001 colour Clear
  39.    colour Clear]
  40. }
  41. }
  42.  
  43. #declare Sunset_Sky = texture {
  44. gradient <0.0 1.0 0.0>
  45.  
  46. colour_map {
  47. [0.0 0.4  /*blue*/
  48. colour red 0.8 green 0.0 blue 0.0
  49. colour red 0.4 green 0.0 blue 0.4]
  50.  
  51. [0.4 0.6  colour red 0.4 green 0.0 blue 0.4
  52. /*white*/
  53. colour red 0.0 green 0.0 blue 0.2]
  54. [0.6 1.001 colour red 0.0 green 0.0 blue 0.2
  55. /*grey*/
  56. colour red 0.0 green 0.0 blue 0.1]
  57. }
  58. scale <700.0 700.0 700.0>
  59. }
  60.  
  61.  
  62. /*************************************************/
  63. /* Define objects for use in scene               */
  64. /*************************************************/
  65.  
  66. #declare Cross =
  67. object {
  68. union {
  69. /* Tried to make celtic cross, but vga resolution is too coarse */
  70. /* intersection
  71.      quadric Cylinder_Z
  72.         scale <0.4 0.4 0.4>
  73.         translate <0.0 0.45 0.0>
  74.      end_quadric
  75.      plane <0.0 0.0 -1.0>  0.02 end_plane
  76.      plane <0.0  0.0 1.0> 0.02 end_plane
  77.      end_intersection */
  78.  
  79. /*vertical part*/
  80. intersection {
  81.    /*top & bottom*/
  82.    plane { <0.0 1.0 0.0> 1.0 }
  83.    plane { <0.0 -1.0 0.0> 2.0 }
  84.    /*front & back*/
  85.    plane { <0.0 0.0 1.0> 0.12 }
  86.    plane { <0.0 0.0 -1.0> 0.12 }
  87.    /*left & right*/
  88.    plane { <1.0 0.0 0.0> 0.15 }
  89.    plane { <-1.0 0.0 0.0> 0.15 }
  90. }
  91.  
  92. /*horizontal part*/
  93. intersection {
  94.    /*top & bottom*/
  95.    plane { <0.0 1.0 0.0> 0.6 }
  96.    plane { <0.0 -1.0 0.0> -0.3 }
  97.    /*front & back*/
  98.    plane { <0.0 0.0 1.0> 0.12 }
  99.    plane { <0.0 0.0 -1.0> 0.12 }
  100.    /*left & right walls*/
  101.    plane { <1.0 0.0 0.0> 0.7 }
  102.    plane { <-1.0 0.0 0.0> 0.7 }
  103. }
  104. }
  105. bounded_by { box { <-.8 -2.1 -.2>  <.8 1.1 .8> } }
  106.  
  107. texture {
  108. HeadTex
  109. scale <0.1 0.1 0.1>
  110. ambient 0.1
  111. diffuse 0.7   
  112. }
  113. colour Blue
  114. }
  115.  
  116. #declare Headstone =
  117. object {
  118. union {
  119. intersection {      
  120.    quadric { Cylinder_Z }
  121.    plane { <0.0 0.0 -1.0>  0.1 }
  122.    plane { <0.0  0.0 1.0> 0.1 }
  123. }            
  124. intersection {
  125.    /*top & bottom*/ 
  126.    plane { <0.0 1.0 0.0> 0.0 }
  127.    plane { <0.0 -1.0 0.0> 2.0 }
  128.    /*front & back*/
  129.    plane { <0.0 0.0 1.0> 0.1 }
  130.    plane { <0.0 0.0 -1.0> 0.1 }
  131.    /*left & right */
  132.    plane { <1.0 0.0 0.0> 1.0 }
  133.    plane { <-1.0 0.0 0.0> 1.0 }
  134. }
  135. }
  136. texture { 
  137. HeadTex
  138. scale<0.1 0.2 0.1>
  139. ambient 0.1
  140. diffuse 0.7   
  141. }
  142. colour Blue
  143. }
  144.  
  145.  
  146. #declare Pole = quadric { Cylinder_Y
  147. scale <0.1 1.0 0.1>
  148. }
  149.  
  150.  
  151. #declare Xpole = quadric { Cylinder_X
  152. scale <0.1 0.1 0.1>
  153. }
  154.  
  155. /* Rusty iron gate & fence - object should have been composite to avoid the */
  156. /*                           "carved from one piece" look. */
  157. #declare Gate = object {
  158. union {
  159. intersection {
  160. quadric { Xpole  }
  161. plane { <1.0 0.0 0.0> 8.0 }
  162. plane { <-1.0 0.0 0.0> 2.0 }
  163. translate <0.0 6.5 0.0>
  164. }
  165. intersection {
  166. quadric { Xpole  }
  167. plane { <1.0 0.0 0.0> 8.0 }
  168. plane { <-1.0 0.0 0.0> 2.0 }
  169. translate <0.0 1.9 0.0>
  170. }
  171. intersection {
  172. quadric { Pole  }
  173. plane { <0.0 1.0 0.0> 7.5 }
  174. plane { <0.0 -1.0 0.0> 0.0 }
  175. translate <1.0 0.0 0.0>
  176. }
  177. sphere { <1.0 7.5 0.0> 0.3 }
  178. intersection {
  179. quadric { Pole }
  180. plane { <0.0 1.0 0.0> 7.75 }
  181. plane { <0.0 -1.0 0.0> 0.2 }
  182. translate <2.5 0.0 0.0>
  183. }
  184. sphere { <2.5 7.75 0.0> 0.3 }
  185. intersection {
  186. quadric { Pole }
  187. plane { <0.0 1.0 0.0> 8.0 }
  188. plane { <0.0 -1.0 0.0> 0.2 }
  189. translate <4.0 0.0 0.0>
  190. }
  191. sphere { <4.0 8.0 0.0> 0.3 }
  192. intersection {
  193. quadric { Pole  }
  194. plane { <0.0 1.0 0.0> 7.75 }
  195. plane { <0.0 -1.0 0.0> 0.2 }
  196. translate<5.5 0.0 0.0>
  197. }
  198. sphere { <5.5 7.75 0.0> 0.3 }
  199. intersection {
  200. quadric { Pole }
  201. plane { <0.0 1.0 0.0> 7.5 }
  202. plane { <0.0 -1.0 0.0> 0.2 }
  203. translate <7.0 0.0 0.0>
  204. }
  205. sphere { <7.0 7.5 0.0> 0.3 }
  206. }
  207. bounded_by {
  208. intersection {
  209. plane { <0.0 1.0 0.0> 9.0 }
  210. plane { <0.0 -1.0 0.0> 0.0 }
  211. plane { <0.0 0.0 1.0> 1.0 }
  212. plane { <0.0 0.0 -1.0> 1.0 }
  213. plane { <1.0 0.0 0.0> 8.0 }
  214. plane { <-1.0 0.0 0.0> 0.0 }
  215. }
  216. }
  217. texture { 
  218. Rust 
  219. ambient 0.2
  220. diffuse 0.9   
  221. }    
  222. colour Blue
  223. }
  224.  
  225. /* a rectangular pad to serve as a footing for the column */
  226. #declare BasePad =
  227. object {
  228. intersection {
  229. plane { <0.0 1.0 0.0> 0.25 }
  230. plane { <0.0 -1.0 0.0> 0.25 }
  231. plane { <0.0 0.0 1.0> 1.2 }
  232. plane { <0.0 0.0 -1.0> 1.2 }
  233. plane { <1.0 0.0 0.0> 1.2 }
  234. plane { <-1.0 0.0 0.0> 1.2 }
  235. }
  236.  
  237. colour red 0.6 green 0.6 blue 0.4
  238. }
  239.  
  240. #declare ColTop =
  241. object { 
  242. union {
  243. box { <-1.5 -.1 -1.5> <1.5 .2 1.5> }
  244. box { <-1.25 .2 -1.25> <1.25 .4 1.25> }
  245. box { <-1 .4 -1> <1 .6 1> }
  246. }
  247. color red .6 green .6 blue .4
  248. }
  249. #declare Beam = quadric { Cylinder_Y  }
  250.  
  251. #declare Beam2 = 
  252. quadric { Cylinder_Y
  253. inverse
  254. scale     <.3 1 .3>
  255. translate <1.4 0 0>
  256. }
  257.  
  258. #declare Beam3 =
  259. object {
  260. intersection {
  261. quadric { Beam  scale <1.2 1 1.2> }
  262. quadric { Beam2 }
  263. quadric { Beam2 rotate <0  -45 0> }
  264. quadric { Beam2 rotate <0  -90 0> }
  265. quadric { Beam2 rotate <0 -135 0> }
  266. quadric { Beam2 rotate <0  180 0> }
  267. quadric { Beam2 rotate <0   45 0> }
  268. quadric { Beam2 rotate <0   90 0> }
  269. quadric { Beam2 rotate <0  135 0> }
  270. plane { <0 1 0>  8 }
  271. plane { <0 -1 0> 0 }
  272. }
  273. color red .8 green 0 blue .0
  274. }
  275.  
  276. #declare Column = composite {
  277. object { Beam3   texture { ColTex } }
  278. //object { BasePad texture { ColTex phong 0 } translate <0 0 0> }
  279. object { ColTop texture { ColTex phong 0 } translate <0 8 0> }
  280. }
  281.  
  282.  
  283. #declare Tomb = object {
  284. union {
  285. difference {
  286. box { <-10 -5 -7.5> <10 10 7.5> } // bulk
  287. box { <-3 -5 -7.0> <3 7 7.6> } // door
  288. }
  289. /* Foundation */
  290. box { <-11 -2 -10.5> <11 -1 10.5> }
  291. box { <-12 -3 -11>   <12 -2 11> }
  292. box { <-13 -4 -12>   <13 -3 12> }
  293. box { <-14 -5 -13>   <14 -4 13> }
  294. }
  295. bounded_by { box { <-14.1 -5.1 -13.1> <14.1 10.1 18.6> } }
  296.  
  297. }
  298.  
  299. #declare InnerBeams = object {
  300. union {
  301. intersection {
  302. quadric { Beam }
  303. plane { <0.0 1.0 0.0> 8.0 }
  304. plane { <0.0 -1.0 0.0> 2.0 }
  305. translate < 5.0 0.0 7.5>
  306. }
  307. intersection {
  308. quadric { Beam }
  309. plane { <0.0 1.0 0.0> 8.0 }
  310. plane { <0.0 -1.0 0.0> 2.0 }
  311. translate < -5.0 0.0 7.5>
  312. }
  313. }
  314. colour Blue
  315. }
  316.  
  317.  
  318. #declare Pointy = object {
  319. union {
  320. /*pointy part*/
  321. intersection {
  322. plane { <0 -1 0> 1 }
  323.  
  324. plane { <0 0 -1> 1 }
  325. plane { <0 0 1> 1 rotate <0 27 0> rotate <40 0 0> }
  326. plane { <0 0 1> 1 rotate <0 -27 0> rotate <40 0 0> }
  327. plane { <1 0 0> 0 rotate <0 0 70> }
  328. plane { <-1 0 0> 0 rotate <0 0 -70> }
  329. scale <3 4 1>
  330. translate < 0 12 8.5>
  331. }
  332. }
  333. color Blue
  334. }
  335.  
  336.  
  337. #declare CornerBeams = object {
  338. union {
  339. intersection {
  340. quadric { Beam scale <1.5 1.0 1.5>}
  341. plane { <0.0 1.0 0.0> 10.0 }
  342. plane { <0.0 -1.0 0.0> 2.0 }
  343. translate < 10.0 0.0 7.5>
  344. }
  345. intersection {      
  346. quadric { Beam scale <1.5 1.0 1.5> }
  347. plane { <0.0 1.0 0.0> 10.0 }
  348. plane { <0.0 -1.0 0.0> 2.0 }
  349. translate < -10.0 0.0 7.5>
  350. }
  351. sphere { < -10.0 10.0 7.5> 1.5 }
  352. sphere { <  10.0 10.0 7.5> 1.5 }
  353. }
  354. colour Blue
  355. }
  356.  
  357. /* Ghost in tomb doorway */
  358. #declare Figure = object {
  359. intersection {
  360. quadric { Beam scale <2.3 1.0 2.3> }
  361. plane { <0.0 1.0 0.0> 8.0 }
  362. plane { <0.0 -1.0 0.0> 2.0 }
  363. translate < 0.0 0.0 4.3>
  364. }
  365. texture {
  366. granite
  367. /* Use any ghost image you like for the tomb doorway or comment */
  368. /* out the Figure in TombAll */
  369. /*imagemap <-1.0 1.0 0.0> gif "ghost.gif" once 
  370.       interpolate 2.0
  371.      end_map*/
  372. scale < 6.5 8.0 6.5 >
  373. translate < -1.0 7.5 4.3 >
  374. ambient 0.10
  375. diffuse 0.3
  376. }
  377. colour Black
  378. }
  379.  
  380. /* TombAll is the completed tomb */
  381. #declare TombAll = composite {
  382. object { Tomb texture { TombTex } }
  383. object { InnerBeams texture { Stone21 } }
  384. object { Pointy texture { Stone4 } }
  385. object { CornerBeams texture { Stone18 scale <.5 .5 .5> } }   
  386. }
  387.  
  388. /* Pumpkin parts */
  389. #declare Stem = object {
  390. intersection {
  391. quadric { Pole  }
  392. plane { <0.0 1.0 0.0> 0.04 rotate <0.0 -10.0 -10.0> }
  393. plane { <0.0 -1.0 0.0> 1.0 }
  394. translate<0.0 0.3 0.0>
  395. }
  396. texture {
  397. bumps 0.5
  398. color red 0.04 green 0.33 blue 0.05
  399. scale < 0.2 0.2 0.2>
  400. ambient 0.1
  401. diffuse 0.9   
  402. }
  403. color red 0.04 green 0.33 blue 0.05
  404. }
  405.  
  406. #declare Slice = quadric {
  407. Ellipsoid
  408. translate <0.0 0.0 0.5>
  409. scale <0.28 0.30 0.40>
  410. }
  411.  
  412. #declare Pumpkin = object {
  413. union {
  414. quadric { Slice }
  415. quadric { Slice rotate <0.0 -20.0  0.0> }
  416. quadric { Slice rotate <0.0 -40.0  0.0> }
  417. quadric { Slice rotate <0.0 -60.0  0.0> }
  418. quadric { Slice rotate <0.0 -80.0  0.0> }
  419. quadric { Slice rotate <0.0 -100.0 0.0> }
  420. quadric { Slice rotate <0.0 -120.0 0.0> }
  421. quadric { Slice rotate <0.0 -140.0 0.0> }
  422. quadric { Slice rotate <0.0 -160.0 0.0> }
  423. quadric { Slice rotate <0.0 -180.0 0.0> }
  424. quadric { Slice rotate <0.0 -200.0 0.0> }
  425. quadric { Slice rotate <0.0 -220.0 0.0> }
  426. quadric { Slice rotate <0.0 -240.0 0.0> }
  427. quadric { Slice rotate <0.0 -260.0 0.0> }
  428. quadric { Slice rotate <0.0 -280.0 0.0> }
  429. quadric { Slice rotate <0.0 -300.0 0.0> }
  430. quadric { Slice rotate <0.0 -320.0 0.0> }
  431. quadric { Slice rotate <0.0 -340.0 0.0> }
  432. }
  433. bounded_by {
  434. quadric { Ellipsoid scale <1.5 1.5 1.5> }
  435. }
  436. texture {
  437. bumps 0.3
  438. color red 0.5 green 0.22 blue 0.1
  439. scale < 0.1 0.1 0.1>
  440. ambient 0.1
  441. diffuse 0.9
  442. phong 0.75
  443. phong_size 30.0
  444. }
  445. color red 0.5 green 0.22 blue 0.1
  446. }
  447.  
  448.  
  449. /*******************************************/
  450. /* Scene description     */
  451. /*******************************************/
  452.  
  453. object {
  454. Cross
  455. scale <1.7 2.0 1.0>
  456. rotate <-15.0 0.0 0.0>
  457. translate <-16.0 7.7 61.5>    
  458. }
  459.  
  460. object {
  461. Headstone
  462. scale <1.0 1.0 1.0>
  463. rotate <15.0 0.0 0.0>
  464. translate <-14.0 4.0 76.0>
  465. }
  466.  
  467. object {
  468. Headstone
  469. scale <1.0 1.0 1.0>
  470. translate <12.0 4.0 74.0>
  471. }
  472.  
  473. object {
  474. Headstone
  475. scale <1.0 1.0 1.0>
  476. rotate <-10.0 0.0 0.0>
  477. translate <18.0 8.0 70.0>
  478. }
  479.  
  480. object {
  481. Cross
  482. scale <1.5 2.0 1.0>
  483. rotate <-15.0 0.0 0.0>
  484. translate <17.0 10.0 60.0>
  485. }
  486.  
  487. object {
  488. Cross
  489. scale <1.5 2.0 1.0>
  490. rotate <-15.0 0.0 20.0>
  491. translate <26.0 10.0 70.0>
  492. }
  493.  
  494. object {
  495. Cross
  496. scale <1.5 2.0 1.0>
  497. rotate <-15.0 0.0 -10.0>
  498. translate <31.0 10.0 78.0>
  499. }
  500.  
  501.  
  502. /* Little Pumpkin Patch */
  503. object {
  504. Pumpkin
  505. scale <1.5 2.0 1.5>
  506. translate < 5.0 1.55 95.0>
  507. }
  508. object {
  509. Stem
  510. scale <1.5 2.5 1.5>
  511. translate < 5.0 1.55 95.0>
  512. }
  513. object {
  514. Pumpkin
  515. scale <1.5 2.5 1.5>
  516. translate < 11.0 1.6 90.0>
  517. }
  518. object {
  519. Stem
  520. scale <1.5 2.5 1.5>
  521. translate < 11.0 1.6 90.0>
  522. }
  523.  
  524.  
  525. /* Ghastly Tomb!*/
  526. composite {
  527. TombAll
  528. rotate <7.0 15.0 0.0>
  529. translate <0.0 16.0 38.0>
  530. }
  531.  
  532. /*left entry gate*/
  533. object {
  534. Gate
  535. translate <-9.0 0.0 88.0>
  536. }
  537.  
  538. /*right entry gate*/
  539. object {
  540. Gate
  541. rotate <-10.0 -160.0 0.0>
  542. translate <7.0 0.0 87.5>
  543. }
  544.  
  545. /*Use gate object to make left & right fence*/
  546. object {
  547. Gate
  548. translate <-19.0 0.0 88.0>
  549. }
  550. object {
  551. Gate
  552. translate <-31.0 0.0 88.0>
  553. }
  554. object {
  555. Gate
  556. translate <9.0 0.0 88.0>
  557. }
  558. object {
  559. Gate
  560. translate <19.0 0.0 88.0>
  561. }
  562.  
  563. /* Columns to hold the fence and gates up */
  564. composite { Column translate <-20.0 0.0 88.0> }
  565. composite { Column translate <-10.0 0.0 88.0> }
  566. composite { Column translate < 8.0 0.0 88.0> }
  567. composite { Column translate < 18.0 0.0 88.0> }
  568.  
  569. /*hill under tomb*/
  570. object {
  571. quadric { Paraboloid_Y
  572. scale<40.0 10.0 77.0>
  573. }
  574. rotate <0.0 0.0 180.0>
  575. translate <0.0 21.0 -28.0>
  576. texture {
  577. bumps 0.8
  578. color red 0.5 green 0.6 blue 0.2
  579. scale < 5.0 5.0 5.0>
  580. ambient 0.1
  581. diffuse 0.7    
  582. }                                         
  583. color red 0.5 green 0.6 blue 0.2
  584. }
  585.  
  586. /*hill to right of tomb*/
  587. object {
  588. quadric { Paraboloid_Y
  589. scale<30.0 10.0 40.0>
  590. }
  591. rotate <0.0 0.0 180.0>
  592. translate <40.0 14.0 50.0>
  593. texture {
  594. bumps 0.8
  595. color red 0.6 green 0.6 blue 0.1
  596. scale < 7.0 5.0 5.0>
  597. ambient 0.1
  598. diffuse 0.7
  599. }
  600. color red 0.6 green 0.6 blue 0.1
  601. }
  602.  
  603. /* Ground */
  604. object {
  605. plane { <0.0 1.0 0.0> 1.0 }
  606. texture {
  607. bumps 0.7
  608. color red 0.6 green 0.6 blue 0.1
  609. scale < 1.0 1.0 1.0>
  610. ambient 0.1
  611. diffuse 0.7
  612. }
  613. color red 0.6 green 0.6 blue 0.1
  614. }
  615.  
  616. /*The Sun*/
  617. object {
  618. light_source { <150.0 30.0 1200.0>
  619. color red 1 green .8 blue .65
  620. }
  621. }
  622.  
  623. /* Sky - gradient sunset*/
  624. object {
  625. sphere { <0.0 0.0 0.0> 2000.0 inverse }
  626. texture {
  627. Sunset_Sky
  628. translate <0.0 200.0 0.0>
  629. scale <1.2 1.2 1.2>
  630. ambient 0.6
  631. diffuse 0.0
  632. }
  633. color Green
  634. }
  635.  
  636. /* Clouds - uses a sky texture with the sky portion defined as transparent */
  637. /*          so the gradient behind it is visible  */
  638. object {
  639. sphere { <0.0 0.0 0.0> 1997.0 inverse }
  640. texture {
  641. Yellow_Clouds
  642. scale <1000.0 30.0 100.0>
  643. ambient 0.7
  644. diffuse 0.0
  645. }
  646. color Green
  647. }
  648.