Catmull-Rom Unity Demo

Catmull-Rom Unity Demo

Development Time: Three Hours
Technology Used: Unity 3D using C# for scripting
Summary:

This demo shows my implementation of a Catmull-Rom spline. A Catmull-Rom spline is a variation of a cubic Hermite spline, where the tangents for a control point is calculated using half the distance from the previous point to the next point. At first I was going to implement a standard cubic Hermite spline, but decided that a Catmull-Rom was a simple enough variation that would save time in calculating the proper tangents. This demo was partially inspired by a presentation I saw by Squirrel Eiserloh at GDC in 2009.

There is a known bug, which causes the camera to bounce a little when reaching the target control point. That could simply be caused the placement of the control points. The pathing works just fine, so I’m not concerned with how smooth the transition is. I’m sure a bit of tweaking would fix it.

Playable Demo:

Source Code:

Click here for the source code (zip 38.1MB)

Tags: , , , , ,

One Response to “Catmull-Rom Unity Demo”

Leave a Reply

Latest Work

Alien Family
Catmull-Rom Unity Demo
Pencil-Pal: Kindergarten
Pencil-Pal: Preschool

Latest Blog Posts

Aiming to be a game engine programmer

  • RSS
  • Twitter
  • Facebook
  • LinkedIn
  • Vimeo