chronozphere
02-02-2010, 10:25 PM
Hey guys
I'm allready thinking about how to make the second version of my Tuberunner game for IGF. I'd like to use splines to generate the racetrack. :)
So I tried to implement a few different spline types. Here's a screenshot of the demo:
http://img707.imageshack.us/img707/8249/splinedemo.jpg
From left to right:
Quadratic bezier spline
Cubic bezier spline
CatmullRom spline
Cubic Hermite spline
I combined 3 catmullRom splines to get a longer spline (check my TCompositeCurve class).
It doesn't work for other spline types now (don't know why). :-[
Download source + exe here (http://nashasoft.na.funpic.org/SplineDemo.rar)
Hope someone finds this usefull. If anyone can think of possible optimizations, please tell me. :)
I'm allready thinking about how to make the second version of my Tuberunner game for IGF. I'd like to use splines to generate the racetrack. :)
So I tried to implement a few different spline types. Here's a screenshot of the demo:
http://img707.imageshack.us/img707/8249/splinedemo.jpg
From left to right:
Quadratic bezier spline
Cubic bezier spline
CatmullRom spline
Cubic Hermite spline
I combined 3 catmullRom splines to get a longer spline (check my TCompositeCurve class).
It doesn't work for other spline types now (don't know why). :-[
Download source + exe here (http://nashasoft.na.funpic.org/SplineDemo.rar)
Hope someone finds this usefull. If anyone can think of possible optimizations, please tell me. :)