First spline generation

So we decided to ditch the track-type generation since having a generation based on a spline and objects along that one would be a lot smoother. After trying to figure out how to make not even generate at the point  bezier spline, I found an easier algorithm: the Catmull-Rom curve. which made it possible to just define controlpoints and the curve is calculated in sections along that curve, it’s a bit more performance heavy but it is a lot easier to generate randomly. Right now I have made the base script for the curve, a proof of concept generator (just uses random positions) and a very simple 1-way spline mover script. We plan on having the generation more smooth by value tweaking and maybe a little change in algorithm and make objects spawn along the spline. The player movement will also have the spline as mid-point so we can just work with offset changing for that. Here is a litle gif showing a generated spline and the walker script.

ezgif-1-c7f3f1ccd9

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s