https://github.com/bubner/bezier
171-point dynamic Bezier curve generator in Unity 2D
https://github.com/bubner/bezier
bezier-curve computer-graphics cs math unity unity-webgl unity2d webgl
Last synced: 5 months ago
JSON representation
171-point dynamic Bezier curve generator in Unity 2D
- Host: GitHub
- URL: https://github.com/bubner/bezier
- Owner: bubner
- Created: 2024-05-20T06:12:56.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-15T10:44:51.000Z (almost 2 years ago)
- Last Synced: 2025-03-29T11:34:32.113Z (about 1 year ago)
- Topics: bezier-curve, computer-graphics, cs, math, unity, unity-webgl, unity2d, webgl
- Language: ShaderLab
- Homepage: https://serve.bubner.me/unity/bezier
- Size: 1.21 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bézier Curves
###### https://serve.bubner.me/unity/bezier
$$\text{Bézier curve general formula}$$
$$B(t) = \sum_{i=0}^{n} \binom{n}{i} (1-t)^{n-i} t^i P_i$$
$$\therefore B(t) = \sum_{i=0}^{n} \frac{n!}{i!(n-i)!} (1-t)^{n-i} t^i P_i$$
$$\because \binom{n}{k} = \frac{n!}{k!(n-k)!}$$
This small Unity app generates Bézier curves using the explicit definition of summated binomial coefficients and linear interpolation. Created as a proof-of-concept and for fun to learn more about the math involved in computer graphics.
## Features
- Add up to 171 points (`double` datatype precision)
- Remove individual or all points
- Edit points and reflect changes dynamically and instantly (like Desmos)
- Scrub along a vector by interpolation ratio `t` with a slider or animation
- Draw-point scrubbing `t` shows construction lines as a set of linear interpolations
- Adjust resolution (delta t) of rendered curve
- Real-time curve rendering
[](https://serve.bubner.me/unity/bezier)