ellipsoid.pov 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #version 3.5;
  2. #include "colors.inc"
  3. #include "glass.inc"
  4. camera {
  5. location <14, 8, 0>
  6. look_at <0, 0, 0>
  7. }
  8. plane {
  9. y, -4
  10. pigment { checker color Gray color White }
  11. }
  12. sphere {
  13. <0, 0, 0>, // center of the spehre
  14. 4 // radius
  15. scale<1,1,1.4>
  16. material { M_Glass }
  17. photons { // photon block for an object
  18. target 1.0
  19. refraction on
  20. reflection on
  21. }
  22. finish {
  23. reflection 0.2 // glass reflects a bit
  24. phong 0.9 phong_size 40 // a highlight
  25. }
  26. }
  27. #declare Axis_texture = //
  28. pigment {
  29. gradient <1,0,0>
  30. color_map {[0.0 color <1,1,1>]
  31. [0.5 color <1,1,1>]
  32. [0.5 color <1,0,0>]
  33. [1.0 color <1,0,0>]
  34. }
  35. scale 2
  36. }
  37. #declare Diameter = 0.1;
  38. #declare LengthX = 5;
  39. #declare LengthY = 8;
  40. #declare LengthZ = 5;
  41. #declare axisY = //
  42. union {
  43. cylinder {
  44. <0, 0, 0>, <LengthY, 0, 0>, Diameter
  45. }
  46. cone { <LengthY, 0, 0>, Diameter * 2, <LengthY + Diameter * 5 , 0, 0>, 0 }
  47. texture { Axis_texture}
  48. finish {ambient 0.1 diffuse 0.9 phong 1}
  49. }
  50. #declare axis = //
  51. union {
  52. cylinder {
  53. <0, 0, 0>, <LengthX, 0, 0>, Diameter
  54. }
  55. cone { <LengthX, 0, 0>, Diameter * 2, <LengthX + Diameter * 5 , 0, 0>, 0 }
  56. texture { Axis_texture}
  57. finish {ambient 0.1 diffuse 0.9 phong 1}
  58. }
  59. declare XYZ_axis = //
  60. union {
  61. text {
  62. ttf "crystal.ttf",
  63. "0",
  64. .1,
  65. 0 scale 0.5
  66. pigment{color<1,1,0>}
  67. }
  68. union {
  69. object {axis}
  70. text {
  71. ttf "crystal.ttf",
  72. "X",
  73. .1,
  74. 0 scale 0.5
  75. pigment{color<1,1,0> }
  76. translate <LengthX, Diameter*2,Diameter*2>
  77. }
  78. }
  79. union {
  80. object {axisY}
  81. text {
  82. ttf "crystal.ttf",
  83. "Y",
  84. .1,
  85. 0 scale 0.5
  86. pigment{color<1,1,0>}
  87. translate <LengthY, Diameter*2,Diameter*2>
  88. }
  89. rotate <0,90,0>
  90. }
  91. union {
  92. object {axis }
  93. text { ttf "crystal.ttf", "Z", .1, 0
  94. rotate <0,0,-90>
  95. scale 0.5
  96. pigment{color<1,1,0>}
  97. translate <LengthZ,Diameter*2,Diameter*2>
  98. }
  99. rotate <0,0,90>
  100. }
  101. }
  102. object {XYZ_axis}
  103. // this should surround the elipsoid: box {<-1, -1, -1> < 1, 1, 1>}
  104. light_source { <5, 10, 10> color White }
  105. light_source { <10, 10, 5> color White }