Math for Game Developers - Rollercoaster! (Cubic Splines)

preview_player
Показать описание
We create a rollercoaster by appending a few cubic interpolations together to get a cubic spline.

Рекомендации по теме
Комментарии
Автор

shit man i just came here cus I didn't pay attention to my math lecture lol
but we found ourself an actual goldmine of a channel damn

HiHi-iugf
Автор

Hey Jorge, this series remains fantastic and very interesting, thank you :)

TheFingledorf
Автор

I didn't understand very much from this video but I got it to work... 😅 Somewhat.
At 14:43 I see that there's a gap near the end point for you too. I thought I did something wrong. I "solved" it by drawing an extra line at the end (after the 'for' loop that draws the lines), using the final position from "m_points".

Two major features are missing:
- get a direction vector, to rotate the thing travelling on it _towards_ that direction
- loop the spline

Warnings coming from Visual Studio on *math/spline.h* from Github (with 5 points on the spline instead of 16):
1. On line 27 it says: Buffer overrun while writing to 'this->m_coeffs': the writable size is '192' bytes, but '240' bytes might be written.
2. On line 37 it says: Index '4' is out of valid index range '0' to '3' for possibly stack allocated buffer 'this->m_coeffs'.
3. On line 41 it says: Reading invalid data from 'this->m_coeffs': the readable size is '192' bytes but '240' bytes may be read.
...and they all go away if you declare the "m_coeffs" array to not be one element short, so that means instead of "m_coeffs[SPLINE_POINTS - 1][4]", it's just "m_coeffs[SPLINE_POINTS][4]" (without the "- 1").

I also found this little gem at line 56, lol:

if (t == SPLINE_POINTS)
t = SPLINE_POINTS - 0.0000f;

Was it meant to suppress a warning or something? Why so many decimals?

zdspider
Автор

Thanks a lot! Just happened to have a homework on this subject :D

siliondragos
Автор

Hi, I wanted to develop an equation for millennium force roller coaster in order to calculate its acceleration. Could you please help? Thanks

bindiyaasar
Автор

to understand all this what should I study first?

darwinmendez
Автор

A while ago I toyed with some splines to get dragons flying around in Minecraft:

Looking forward to the arc length video cause I had some trouble doing that analytically.
I ended up doing it numerically.

TomyLobo
Автор

Hey Jorge .Really loving these series of math tutorials . But a problem i am facing is i cant seem to get the source code working, even in vs2010 . I am understanding the theory, even make notes for it but i think it would be much more helpful when i can actually implement it. Even tried to make it work in vs 2015 and 2012 but no dice. It seems your tutorial are all mostly based on it and would very much appreciate it, if u could make a step by step video tutorial on how to make it to work.

poseven
Автор

Hey how does this work with three dimensional data?

jkw
Автор

Hey, man. Will you ever cover Verlet Integration or Inverse Kinematics?

AfterthoughtTV
Автор

Just saw the "debunking anita sarkeesian parody"...
Damn...
And down goes the respect for you

TheMrKeksLp
join shbcf.ru