Advertisement
lezed1

4-triangular-bifrusta.pov

Jul 11th, 2014
2,546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "colors.inc"
  2. #include "PolyhedronKit.inc"
  3. #declare light=<1, 0, 0> * 2;
  4. #declare light=<1, 1, 1> * 1.3;
  5.  
  6. background {color White}
  7. camera {location light look_at <0, 0, 0>}
  8. //camera {location <-5, 0, 0> look_at <0, 0, 0>}
  9.  
  10. light_source {light color White}
  11. light_source {<0, 0, 0> color White}
  12.  
  13. #macro triBifrusta(xrot, yrot, zrot, thick, ocolor)
  14.   #declare height = .6;
  15.   #declare bwidth = 1;
  16.   #declare swidth = .75;
  17.  
  18.   // Main axis points
  19.   #declare p1 = <0, 0, .577 * bwidth>;
  20.   #declare p2 = <-.5 * bwidth, 0, -.289 * bwidth>;
  21.   #declare p3 = <.5 * bwidth, 0, -.289 * bwidth>;
  22.  
  23.   // Positive axis points
  24.   #declare p4 = <0, height, .577 * swidth>;
  25.   #declare p5 = <-.5 * swidth, height, -.289 * swidth>;
  26.   #declare p6 = <.5 * swidth, height, -.289 * swidth>;
  27.  
  28.   // Negative axis points
  29.   #declare p7 = <0, -height, .577 * swidth>;
  30.   #declare p8 = <-.5 * swidth, -height, -.289 * swidth>;
  31.   #declare p9 = <.5 * swidth, -height, -.289 * swidth>;
  32.  
  33.   // Trying to keep a constant width for ease of folding
  34.   #declare pwidth=.05;
  35.  
  36.   // Upper then lower triangular faces
  37.   #declare triAngle=0;
  38.   otriangle(p4, p5, p6, triAngle, pwidth, <xrot, yrot, zrot>, ocolor, true)
  39.   otriangle(p7, p8, p9, triAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
  40.  
  41.   // Upper then lower trapezoidal faces
  42.   #declare trapAngle=0;
  43.   oquad(p1, p2, p5, p4, trapAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
  44.   oquad(p2, p3, p6, p5, trapAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
  45.   oquad(p3, p1, p4, p6, trapAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
  46.  
  47.   oquad(p1, p2, p8, p7, trapAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
  48.   oquad(p2, p3, p9, p8, trapAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
  49.   oquad(p3, p1, p7, p9, trapAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
  50.  
  51. #end
  52.  
  53. //triBifrusta(0, 0, 0, .1, Orange)
  54.  
  55. triBifrusta(30, 35.2644, 45, .1, Orange)
  56. triBifrusta(-30, -35.2644, 45, .1, Magenta)
  57. triBifrusta(30, 35.2644, -45, .1, Green)
  58. triBifrusta(-30, -35.2644, -45, .1, Yellow)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement