Advertisement
Guest User

Quaternion-sqr-cube-slice-povray.pov

a guest
Sep 17th, 2013
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.49 KB | None | 0 0
  1. // POV-Ray 3.7 Scene File " ... .pov"
  2. // author: ... alij
  3. // date: ...
  4.  
  5. //--------------------------------------------------------------------------
  6.  
  7. //Sources
  8. //Information on Quaternion Julia Fractals and my initial starting point using his q.pov
  9. //file
  10. //http://paulbourke.net/fractals/quatjulia/
  11.  
  12. //PovRay Julia Fractal help - http://www.povray.org/documentation/view/3.7.0/280/
  13.  
  14. //and http://www.math.technion.ac.il/Site/computing/docs/povray/pov243.html more detailed
  15. //information on PovRay Julia Fractal funtions
  16.  
  17. //http://www.youtube.com/watch?v=nhhBWge1KBk - video by bdchambers79
  18. //showing coordinate animation Cycling through the Julia parameters.
  19. //May be useful for pinning down shape you want to use.
  20.  
  21. //In current state this file is to render two groups of Julia Fractals side by side
  22. //sliced to reveal structure at different iterations and one group using the
  23. //"sqr" cacluation and the other "cube" - to compare difference while using the same
  24. //4D_Julia_Parameters
  25.  
  26. //Excuse my messy code style hopefully you will be able to get this to run on your system
  27. //without too many issues - I think the Povray include files are all standard. you may need to
  28. //comment out the hdri section or add your own hdri skymap.
  29.  
  30. //--------------------------------------------------------------------------
  31. #version 3.7;
  32. global_settings{ assumed_gamma 1.0 }
  33. #default{ finish{ ambient 0.1 diffuse 0.9 }}
  34. //--------------------------------------------------------------------------
  35. #include "colors.inc"
  36. #include "textures.inc"
  37. #include "glass.inc"
  38. #include "metals.inc"
  39. #include "golds.inc"
  40. #include "stones.inc"
  41. #include "woods.inc"
  42. #include "shapes.inc"
  43. #include "shapes2.inc"
  44. #include "functions.inc"
  45. #include "math.inc"
  46. #include "transforms.inc"
  47.  
  48. // Quaternion variables - 4D_Julia_Parameter
  49. // Rotation of the two groups - and positioning.
  50. // Iteration count is in the code for each instance
  51.  
  52. #declare ConstC = <-0.187,0.74,-0.03,-0.752>;
  53. #declare ConstD = <-0.087,0.84,-0.03,-0.452>;
  54. #declare ConstE = <-0.01,0.84,-0.40,-0.5965>;
  55. #declare SLICEDIST = 0.01;
  56. //rotate groups
  57. #declare ConstROT1 = <0,0,0>;
  58. #declare ConstROT2 = <90,90,90>;
  59. //translate groups // Note you may need to adjust the clipping planes in relation to any tranformations
  60. #declare ConstTRANS1 = <0,1.1,0.0>;
  61. #declare ConstTRANS2 = <-0,1.1,-1.4>;
  62. //scale groups
  63. #declare ConstScale1 = <-0.85,0.85,0.85>;
  64. #declare ConstScale2 = <-0.75,0.75,0.75>;
  65. //////////////////////////////////////////////
  66.  
  67.  
  68. #declare Use_Radiosity = 1;
  69. #declare Soft_Shadows = 0;
  70. global_settings {
  71.  
  72. #ifdef (Use_Radiosity)
  73. radiosity { }
  74. #end }
  75.  
  76.  
  77. ///////////////////
  78. // comment out hdri - or suppy your own .hdr image // source http://www.pauldebevec.com/Probes/
  79.  
  80. //hdri environment -------------------------
  81. sky_sphere{
  82. pigment{
  83. image_map{ hdr "/home/ali/POV-Ray/hdri/rnl_probe.hdr"
  84. gamma 0.2
  85. map_type 0 interpolate 2}
  86. }// end pigment
  87. rotate <0,40,0>
  88. }
  89. // end sky_sphere with hdr image -----------
  90. /////////////////
  91. /* sky_sphere {
  92. pigment {
  93. gradient y
  94. color_map {
  95. [0 color SlateBlue ]
  96. [1 color Silver] }
  97. scale 1
  98. translate -2
  99. }
  100. }
  101. */
  102.  
  103. ////Comment in-out which texture styly you want - metal slow - color fast//////
  104. #declare texture_1 = texture { T_Brass_1D }
  105. #declare texture_2 = texture { T_Silver_1A }
  106. /*#declare texture_1 =
  107. texture {
  108. pigment { color Red }
  109. }
  110.  
  111. #declare texture_2 =
  112. texture {
  113. pigment { color Green }
  114. } */
  115. //--------------------------------------------------------------------------
  116. // camera ------------------------------------------------------------------
  117. #declare Camera_0 = camera { angle 75 // front view
  118. location <2.5 ,1 ,-1>
  119. right x*image_width/image_height
  120. look_at <-30 , 2 , 4>}
  121. #declare Camera_1 = camera {/*ultra_wide_angle*/ angle 90 // diagonal view
  122. location <2.0 , 0. ,-0.2>
  123. right x*image_width/image_height
  124. look_at <0.0 , 1.0 , -1.0>
  125.  
  126. }
  127. #declare Camera_2 = camera {perspective angle 75 //right side view
  128. location <3.0 , 1.0 , 0.0>
  129. right x*image_width/image_height
  130. look_at <0.0 , 1.0 , 0.0>}
  131.  
  132. #declare Camera_3 = camera {/*ultra_wide_angle*/ angle 90 // top view
  133. location <0.0 , 5.0 ,-0.001>
  134. right x*image_width/image_height
  135. look_at <0.0 , 1.0 , 0.0>}
  136. camera{Camera_0}
  137. // sun ----------------------------------------------------------------------
  138. light_source{
  139. < 500,700,-700> color White
  140. area_light <8, 0, 0>, <0, 8, 0>, 17, 17
  141. adaptive 1
  142. jitter
  143. fade_distance 1.10
  144. fade_power 1.10
  145. //shadowless
  146. }
  147. // sky ----------------------------------------------------------------------
  148. //background {
  149. // color Blue }
  150.  
  151. //sky_sphere {
  152. // pigment {
  153. // gradient y
  154. // color_map {
  155. // [0 color CornflowerBlue]
  156. // [1 color Silver]
  157. // }
  158. // scale 2
  159. // translate -2
  160. // }
  161. // }
  162. // ground -------------------------------------------------------------------
  163. /*plane{ <0,1,0>, 0
  164. //texture{ Polished_Chrome
  165. // normal{ bumps 0.25 scale <0.25,0.25,0.25>*0.5 turbulence 0.04 }
  166. // finish{ reflection 0.10 }}}
  167. finish{ reflection 0.0 }
  168. pigment { color White }}
  169. // end of plane */
  170. //---------------------------------------------------------------------------
  171. //---------------------------- objects in scene ----------------------------
  172. //---------------------------------------------------------------------------
  173. // THIS SECTION - sqr
  174. julia_fractal {
  175. ConstE
  176. quaternion
  177. sqr
  178. max_iteration 4
  179. precision 900
  180. slice <0,0,0,1> SLICEDIST
  181. texture { texture_1 }
  182. scale ConstScale1
  183. rotate ConstROT1
  184. translate ConstTRANS1
  185.  
  186. clipped_by { plane { <0, 1, 0>, 0.25
  187. rotate<90,210,1>
  188. scale<-0.1,0.1,0.1>
  189. translate<0.5,0,0>
  190. }
  191. }
  192. }
  193.  
  194. julia_fractal {
  195. ConstE
  196. quaternion
  197. sqr
  198. max_iteration 5
  199. precision 900
  200. slice <0,0,0,1> SLICEDIST
  201. texture { texture_2 }
  202. scale ConstScale1
  203. rotate ConstROT1
  204. translate ConstTRANS1
  205. clipped_by { plane { <0, 1, 0>, 0.25
  206. rotate<90,210,1>
  207. scale<-0.1,0.1,0.1>
  208. translate<0.5,0,0>
  209. }
  210. }
  211. }
  212.  
  213. julia_fractal {
  214. ConstE
  215. quaternion
  216. sqr
  217. max_iteration 6
  218. precision 900
  219. slice <0,0,0,1> SLICEDIST
  220. texture { texture_1 }
  221. scale ConstScale1
  222. rotate ConstROT1
  223. translate ConstTRANS1
  224. clipped_by { plane { <0, 1, 0>, 0.25
  225. rotate<90,210,1>
  226. scale<-0.1,0.1,0.1>
  227. translate<0.5,0,0>
  228. }
  229. }
  230. }
  231. julia_fractal {
  232. ConstE
  233. quaternion
  234. sqr
  235. max_iteration 7
  236. precision 900
  237. slice <0,0,0,1> SLICEDIST
  238. texture { texture_2 }
  239. scale ConstScale1
  240. rotate ConstROT1
  241. translate ConstTRANS1
  242. clipped_by { plane { <0, 1, 0>, 0.25
  243. rotate<90,210,1>
  244. scale<-0.1,0.1,0.1>
  245. translate<0.5,0,0>
  246. }
  247. }
  248. }
  249.  
  250. julia_fractal {
  251. ConstE
  252. quaternion
  253. sqr
  254. max_iteration 8
  255. precision 900
  256. slice <0,0,0,1> SLICEDIST
  257. texture { texture_1 }
  258. scale ConstScale1
  259. rotate ConstROT1
  260. translate ConstTRANS1
  261. clipped_by { plane { <0, 1, 0>, 0.25
  262. rotate<90,210,1>
  263. scale<-0.1,0.1,0.1>
  264. translate<0.5,0,0>
  265. }
  266. }
  267. }
  268.  
  269. julia_fractal {
  270. ConstE
  271. quaternion
  272. sqr
  273. max_iteration 9
  274. precision 900
  275. slice <0,0,0,1> SLICEDIST
  276. texture { texture_2 }
  277. scale ConstScale1
  278. rotate ConstROT1
  279. translate ConstTRANS1
  280. clipped_by { plane { <0, 1, 0>, 0.25
  281. rotate<90,210,1>
  282. scale<-0.1,0.1,0.1>
  283. translate<0.5,0,0>
  284. }
  285. }
  286. }
  287.  
  288. julia_fractal {
  289. ConstE
  290. quaternion
  291. sqr
  292. max_iteration 10
  293. precision 900
  294. slice <0,0,0,1> SLICEDIST
  295. texture { texture_1 }
  296. scale ConstScale1
  297. rotate ConstROT1
  298. translate ConstTRANS1
  299. //Commented out clipping plane to show full uncut quaternion
  300. // clipped_by { plane { <0, 1, 0>, 0.25
  301. // rotate<90,210,1>
  302. // scale<-0.1,0.1,0.1>
  303. // translate<0.5,0,0>
  304. // }
  305. // }
  306. }
  307.  
  308. /////////////////////////////////////////////////////////////////////////////
  309.  
  310. // cube - calculation
  311.  
  312. julia_fractal {
  313. ConstE
  314. quaternion
  315. cube
  316. max_iteration 4
  317. precision 900
  318. slice <0,0,0,1> SLICEDIST
  319. texture { texture_1 }
  320. scale ConstScale2
  321. rotate ConstROT2
  322. translate ConstTRANS2
  323. clipped_by { plane { <0, 1, 0>, 0.25
  324. rotate<0,0,9>
  325. scale<-0.1,0.1,0.1>
  326. translate<0,0.5,0> }
  327. }
  328. }
  329.  
  330. julia_fractal {
  331. ConstE
  332. quaternion
  333. cube
  334. max_iteration 5
  335. precision 900
  336. slice <0,0,0,1> SLICEDIST
  337. texture { texture_2 }
  338. scale ConstScale2
  339. rotate ConstROT2
  340. translate ConstTRANS2
  341. clipped_by { plane { <0, 1, 0>, 0.25
  342. rotate<0,0,9>
  343. scale<-0.1,0.1,0.1>
  344. translate<0,0.6,0> }
  345. }
  346. }
  347.  
  348. julia_fractal {
  349. ConstE
  350. quaternion
  351. cube
  352. max_iteration 6
  353. precision 900
  354. slice <0,0,0,1> SLICEDIST
  355. texture { texture_1 }
  356. scale ConstScale2
  357. rotate ConstROT2
  358. translate ConstTRANS2
  359.  
  360. clipped_by { plane { <0, 1, 0>, 0.25
  361. rotate<0,0,9>
  362. scale<-0.1,0.1,0.1>
  363. translate<0,0.7,0> }
  364. }
  365. }
  366.  
  367. julia_fractal {
  368. ConstE
  369. quaternion
  370. cube
  371. max_iteration 7
  372. precision 900
  373. slice <0,0,0,1> SLICEDIST
  374. texture { texture_2 }
  375. scale ConstScale2
  376. rotate ConstROT2
  377. translate ConstTRANS2
  378. clipped_by { plane { <0, 1, 0>, 0.25
  379. rotate<0,0,9>
  380. scale<-0.1,0.1,0.1>
  381. translate<0,0.8,0> }
  382. }
  383. }
  384.  
  385. julia_fractal {
  386. ConstE
  387. quaternion
  388. cube
  389. max_iteration 8
  390. precision 900
  391. slice <0,0,0,1> SLICEDIST
  392. texture { texture_1 }
  393. scale ConstScale2
  394. rotate ConstROT2
  395. translate ConstTRANS2
  396. clipped_by { plane { <0, 1, 0>, 0.25
  397. rotate<0,0,9>
  398. scale<-0.1,0.1,0.1>
  399. translate<0,0.9,0> }
  400. }
  401. }
  402.  
  403. julia_fractal {
  404. ConstE
  405. quaternion
  406. cube
  407. max_iteration 9
  408. precision 900
  409. slice <0,0,0,1> SLICEDIST
  410. texture { texture_2 }
  411. scale ConstScale2
  412. rotate ConstROT2
  413. translate ConstTRANS2
  414. clipped_by { plane { <0, 1, 0>, 0.25
  415. rotate<0,0,9>
  416. scale<-0.1,0.1,0.1>
  417. translate<0,1.0,0> }
  418. }
  419. }
  420.  
  421. julia_fractal {
  422. ConstE
  423. quaternion
  424. cube
  425. max_iteration 10
  426. precision 900
  427. slice <0,0,0,1> SLICEDIST
  428. texture { texture_1 }
  429. scale ConstScale2
  430. rotate ConstROT2
  431. translate ConstTRANS2
  432. clipped_by { plane { <0, 1, 0>, 0.25
  433. rotate<0,0,9>
  434. scale<-0.1,0.1,0.1>
  435. translate<0,1.1,0> }
  436. }
  437. }
  438.  
  439. julia_fractal {
  440. ConstE
  441. quaternion
  442. cube
  443. max_iteration 10
  444. precision 900
  445. slice <0,0,0,1> SLICEDIST
  446. texture { texture_1 }
  447. scale ConstScale2
  448. rotate ConstROT2
  449. translate ConstTRANS2
  450. //Commented out clipping plane to show full uncut quaternion
  451. // clipped_by { plane { <0, 1, 0>, 0.25
  452.  
  453. // rotate<0,0,9>
  454. // scale<-0.1,0.1,0.1>
  455. // translate<0,1.1,0> }
  456. // }
  457. }
  458.  
  459. // plane { <0, 1, 0>, 0.25
  460. // rotate<0,0,0>
  461. // scale<-0.1,0.1,0.1>
  462. // translate<0,0.5,0> }
  463.  
  464. plane { <0, 1, 0>, 0.25
  465. texture {pigment { color White }}
  466. rotate<90,90,0>
  467. scale<-0.1,0.1,0.1>
  468. translate<-120,0,0> }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement