GPP Dev Diary 5

Curves and splines

After looking at available options I decided to use Bézier curves. Bézier curves are relatively simple and widely used in computer graphic. I started by implementing necessary math formulas for linear, quadratic and cubic curves. This is all we need because I'll be combining those lower order curves to create more complex splines. We use this approach because higher order curves are very computationally expensive. With the math formulas added I worked on adding the functions that would handle combining multiple sections into one large curve.

Next I started working on providing an easy way to crate and modify the curves. I ended up crating a custom inspector that will create the controls points for you so all you have to do is simply drag them to the desired position.

The last thing to do was to add a follower script so that object can actually fallow the spline. I create an example follower that continuously follows the curve with a uniform speed across the whole cure and rotates to follow the curvature. This follower can be directly used for some simple use cases or extended to create more advanced behaviors

Comments

  1. All collectively, they make up for 21% of casino desk recreation motion. Poker considered one of the|is among the|is likely certainly one of the} most incessantly performed card video games, and it is probably the most well-known of them all, from a mediatic perspective, and in addition typically speaking. There are dozens of various variations of this recreation, the most well-known of that are Texas maintain 'em and the classic five-card draw 메리트카지노 poker.

    ReplyDelete

Post a Comment

Popular Posts