I moved to a new URL! Check it out!

Dev Log: Bezier Curves

Dev Log: Bezier Curves
This week has kinda sucked for game development stuff. I'm not really sure why, but I just haven't really felt super inspired to work on anything lately, and when I do try to work on things I feel like everything I make is just terrible so I procrastinate. It's a vicious cycle! So I tried to think of maybe something I can add to Otter because that should be easy enough.

I decided to try and just learn about bezier curves in more detail. I've never used them in a game, but it seems like they would be handy in a lot of aspects of game development. I found this quick tutorial and got started with recreating the example code in Otter.

Image


Although... I'm not sure if this is looking quite right. I'm pretty sure I'm doing the same exact code in the example, but for some reason every curve on my bezier path has sharp end points with the next curve on the path... so for now I'm going to have to look into this further, but the current source is in the Util class in Otter's dev branch if anyone wants to give it a look!

Comments

Jesse Chounard
Jesse Chounard
It doesn't look wrong. You can easily get Bezier Curves that look like that if you play with the control points a bit. (Just play with them in Inkscape for a few minutes.)

It might be worth looking into Catmull Rom splines too. I prefer them for certain tasks, because all of the control points (except for the ends) actually lie on the path.
Posted October 10th 2014 5:38 PM
Kyle
Kyle
Yeah, just after posting thing Chevy Ray introduced me to Catmull Rom and I also added some functions in the Util class for that as well!
Posted October 10th 2014 7:07 PM
Kyle
Kyle
Also regarding the sharp turns on the edges: Yeah, after having a closer look at drawing programs it looks like they add control points automatically in a way that makes the curve pass through the point and curve to the next. It seems that for each point the previous control point and the next control point have to be collinear with the point. That makes the curve not look all weird and have sharp turns.
Posted October 10th 2014 10:38 PM
new comment!

Post your comment!

Name
Email
Comment