# Math model of an ice-cream — Generating Custom Meshes with Unity

I want to share some of my hobby work, i hope you all enjoy, can find and learn or inspire some new things. This is not going to be an unity lesson but not less, i will share some info how it can be done make an ice cream feeling view with custom meshes on unity.

The formulation is easy to grasp yet the outcome is brilliant, feeling just like the ice-cream machine does whipping the cream.

The math behind it is quadratic bezier curves and a through calculations upon it. Mesh calculations done upon this.

Quadratic Bezier curve is a

point-to-point linear interpolation of two Linear Bezier Curves. For given three points P0, P1 and P2, a quadratic bezier curve is a linear interpolation of two points, got from Linear Bezier curve of P0 and P1 and Linear Bezier Curve of P1 and P2

There is an addon for the mesh.

Controlling the angle between star shaped cream is all modded.

The screw angle when whipping the cream is also custom and your choice.

Total vertex count affects the smoothness of the mesh at the end.

Levering is for icecream height but it depends also creamradius and indentation as well.

There is shader for the cream as pearl white right now but shaders can set to cocoa, or any color you like.

To be continued..

This content is coffee-ware so if you interested you can mail me to use it as an asset.