Advertisement
cwkitkat

Untitled

Feb 19th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. fn flowersimulator =
  2. (
  3. for i = 9 to 20 do
  4. (
  5. stem = cylinder radius: 1 height: 20 heightsegs: 20
  6.  
  7. s1 = sphere radius: 2.5 segment: 50
  8. r1 = box length: 5 width: 5 height: 5
  9. bud = s1 - r1
  10. delete r1
  11. bud.parent = stem
  12. in coordsys parent move bud [0,0,21.5]
  13.  
  14. petal1 = prism side1length: 10 side2length:10 side3length:5 height: 1
  15. petal1.parent = bud
  16. in coordsys parent move petal1 [0,0,20]
  17. move petal1 [2,-1.5,0]
  18. addmodifier petal1 (turbosmooth())
  19. addmodifier bud (turbosmooth())
  20. addmodifier stem (turbosmooth())
  21.  
  22. petal2 = copy petal1 pos: [0,0,20]
  23. petal3 = copy petal1 pos: [0,0,20]
  24. petal4 = copy petal1 pos: [0,0,20]
  25. petal5 = copy petal1 pos: [0,0,20]
  26. petal6 = copy petal1 pos: [0,0,20]
  27. petal7 = copy petal1 pos: [0,0,20]
  28. petal8 = copy petal1 pos: [0,0,20]
  29. petal9 = copy petal1 pos: [0,0,20]
  30.  
  31.  
  32. petal2.rotation.z_rotation = -45
  33. petal3.rotation.z_rotation = -90
  34. petal4.rotation.z_rotation = -135
  35. petal5.rotation.z_rotation = -180
  36. petal6.rotation.z_rotation = -225
  37. petal7.rotation.z_rotation = -270
  38. petal8.rotation.z_rotation = -315
  39. petal9.rotation.z_rotation = -360
  40.  
  41. delete petal1
  42.  
  43. flower1 = petal2 + petal3 + petal4 + petal5 + petal6 + petal7 + petal8 + petal9 + bud + stem
  44.  
  45. colourChance = random 2 3
  46. colourRoll = random 1 5
  47. if colourRoll < colourChance then
  48. colourChosen = red
  49. else if colourRoll == colourChance then
  50. colourChosen = yellow
  51. else
  52. colourChosen = blue
  53.  
  54. Flower = copy flower1 pos:[0,0,20] wirecolor: colourChosen
  55. delete flower1
  56. delete petal3
  57. delete petal4
  58. delete petal5
  59. delete petal6
  60. delete petal7
  61. delete petal8
  62. delete petal9
  63. delete bud
  64. delete stem
  65.  
  66. addmodifier Flower (bend angle: (random -45 45))
  67. Flower.rotation.x_rotation = -15
  68. Flower.rotation.y_rotation = 30
  69. move Flower [(random -10 10)*i, (random -10 10)*i,-1.5]
  70.  
  71. with animate on
  72. (
  73. at time 0 flower.scale = [0,0,0]
  74. at time 100 flower.scale = [1,1,1]
  75. )
  76. )
  77. )
  78.  
  79. flowersimulator()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement