# How To Make Stem Bloom Into A Leaf?

**URL:** https://discourse.processing.org/t/how-to-make-stem-bloom-into-a-leaf/7950
**Category:** Coding Questions
**Created:** [January 29, 2019, 11:44pm UTC](https://discourse.processing.org/t/how-to-make-stem-bloom-into-a-leaf/7950 "2019-01-29T23:44:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lgdelacruz](https://avatars.discourse-cdn.com/v4/letter/l/c4cdca/32.png) [@lgdelacruz](https://discourse.processing.org/u/lgdelacruz)
#### Post date: [January 29, 2019, 11:44pm UTC](https://discourse.processing.org/t/how-to-make-stem-bloom-into-a-leaf/7950/1 "2019-01-29T23:44:35Z")

</div>

I’m trying to bloom this stem: A stem is basically an elongated rectangle.

Into this leaf:

![Petal](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/25d5d2317ea73cbef27b5bad1bf4881f72042c0c.png)

I’m trying to animate the blooming of this stem into this leaf. However, I struggle to make it look organic. How can I achieve this animation and make it look like an organic leaf blooming.

Thanks,  
Lester

---

<div class="post-metadata">

### Author: ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)
#### Post date: [January 30, 2019, 5:31am UTC](https://discourse.processing.org/t/how-to-make-stem-bloom-into-a-leaf/7950/2 "2019-01-30T05:31:19Z")

</div>

Check the easing function:

- [Easing (smooth transitions) with functions instead of two variables? - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/22925/easing-smooth-transitions-with-functions-instead-of-two-variables)

- Lerp and linear interpolation: [https://www.youtube.com/watch?v=8uLVnM36XUc](https://www.youtube.com/watch?v=8uLVnM36XUc)

This is done in java. You should be able to translate it easily to p5.js. If you run into any problem, show your code please (a small version).

Kf

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [February 4, 2019, 9:47pm UTC](https://discourse.processing.org/t/how-to-make-stem-bloom-into-a-leaf/7950/3 "2019-02-04T21:47:44Z")

</div>

> [@lgdelacruz](#):
>
> A stem is basically an elongated rectangle. […] However, I struggle to make it look organic.

I hope you found a solution!

One thing is about organic shapes in general is that they are almost never elongated rectangles. Instead, the are often an iteration of many similar shapes, changing slightly in distance, angle, and/or size each time.

Here are a couple crude examples in Processing(Java).

```auto
void draw(){
  fill(0);
  
  // stem 1
  rect(width/3, height, 10, -frameCount);
  
  // stem 2
  for(int i=0; i<frameCount; i++){
    translate(0,-1);
    rotate(-0.002);
  }
  ellipse(2*width/3, height, 10, 10);
}

```

There is a _lot_ of discussion of this in Shiffman’s **The Nature of Code.**

with very best regards,  
Jeremy
