Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn flowersimulator =
- (
- for i = 9 to 20 do
- (
- stem = cylinder radius: 1 height: 20 heightsegs: 20
- s1 = sphere radius: 2.5 segment: 50
- r1 = box length: 5 width: 5 height: 5
- bud = s1 - r1
- delete r1
- bud.parent = stem
- in coordsys parent move bud [0,0,21.5]
- petal1 = prism side1length: 10 side2length:10 side3length:5 height: 1
- petal1.parent = bud
- in coordsys parent move petal1 [0,0,20]
- move petal1 [2,-1.5,0]
- addmodifier petal1 (turbosmooth())
- addmodifier bud (turbosmooth())
- addmodifier stem (turbosmooth())
- petal2 = copy petal1 pos: [0,0,20]
- petal3 = copy petal1 pos: [0,0,20]
- petal4 = copy petal1 pos: [0,0,20]
- petal5 = copy petal1 pos: [0,0,20]
- petal6 = copy petal1 pos: [0,0,20]
- petal7 = copy petal1 pos: [0,0,20]
- petal8 = copy petal1 pos: [0,0,20]
- petal9 = copy petal1 pos: [0,0,20]
- petal2.rotation.z_rotation = -45
- petal3.rotation.z_rotation = -90
- petal4.rotation.z_rotation = -135
- petal5.rotation.z_rotation = -180
- petal6.rotation.z_rotation = -225
- petal7.rotation.z_rotation = -270
- petal8.rotation.z_rotation = -315
- petal9.rotation.z_rotation = -360
- delete petal1
- flower1 = petal2 + petal3 + petal4 + petal5 + petal6 + petal7 + petal8 + petal9 + bud + stem
- colourChance = random 2 3
- colourRoll = random 1 5
- if colourRoll < colourChance then
- colourChosen = red
- else if colourRoll == colourChance then
- colourChosen = yellow
- else
- colourChosen = blue
- Flower = copy flower1 pos:[0,0,20] wirecolor: colourChosen
- delete flower1
- delete petal3
- delete petal4
- delete petal5
- delete petal6
- delete petal7
- delete petal8
- delete petal9
- delete bud
- delete stem
- addmodifier Flower (bend angle: (random -45 45))
- Flower.rotation.x_rotation = -15
- Flower.rotation.y_rotation = 30
- move Flower [(random -10 10)*i, (random -10 10)*i,-1.5]
- with animate on
- (
- at time 0 flower.scale = [0,0,0]
- at time 100 flower.scale = [1,1,1]
- )
- )
- )
- flowersimulator()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement