Status: Finished
Info
This Bezier Curve Generator was made to teach myself some procedural generation, and mathematics.
Next to that one of the big goals was to create geometry through script. This meant writing custom geometry builders and properly UV-wrapping the textures on them. The generator heavily uses tangent + dot product mathematics. Both of which my studies did cover, but only briefly, and I therefore wanted to further deepen the knowledge. One of the potential outcomes of the project could be a racetrack generator, but I went on to other projects after the track generation was done. As other games and projects were more enjoyable and challenging to me. |
Process
The generator holds a list of 3-4 control points, these control points influence the way the bezier curve generates.
Each control point has some influence on the final curve, as indicated by the Bezier curve formula made by Piere Bézier. I worked out 2 methods/approaches to generating a bezier curve. The first, in my opinion easiest, is to Linearly Interpolate between each control point, drawing lines between the points on the lines between the control points, linearly interpolate again, and continue this process until only 1 line is left. This line is then used to create the points for the Bezier curve. The second approach, which I took, was to work out the formula made by Mister Bézier, into something understandable in C#/Unity. During the entire process I came accross some other interesting things, I have not yet dabbled in, which were Quaternions. These gave me quite a pain, they are used extensively by Unity for rotations, these do not always nicely work together with eulerangles, which I am used to using. |
Goals:
Tools:
Unity, Photoshop (for the texture), Pen and Paper, Math-a-Magician/Colleague |