Catmull Rom Spline Demo And Source Code

Sdílet
Vložit
  • čas přidán 2. 01. 2018
  • This demo shows Catmull Rom Spline Curves.
    Written using the Blitzmax language.
    Windows Demo And Source Code available here
    Catmull_Rom_Spline_Demo_And_Source_Code.zip
    www.dropbox.com/scl/fo/8r5k4t...
    The neat thing about this demo is that it allows for movement along the spline at a constant speed.
    It achieves this by taking the differential of the spline and using that as a scale factor for the current speed.
    You can see this in effect in the demo.
    Pressing Space toggles normal mode and constant speed mode.
    With normal speed mode, the sprite speeds up and slows down depending on how long or short the curve segment is.
    Sometimes this is a desired effect. I used it in my game Zytron 2 for the enemies and it looks pretty cool as they speed up and slow down as they move across the screen.
    Other times though, you may need a constant speed and this demo and source code allows for that.
  • Hry

Komentáře •