I really can only join the praise. It's simply amazing how you manage to add so much info while still being that intelligible
4 жыл бұрын
Huge thanks for these two videos. I always find using graphs, diagrams etc to be crucial for me to understanding abstract things like this and you've certainly helped immensely in doing this - cheers. Really enjoy your videos, gives the old grey matter some needed exercise.
@bobdero98837 жыл бұрын
There it is, excellent video. I've been neglecting catmull-rom splines for a long time, even though I'm very familiar with bezier curves and parametric surfaces implementantions. I must say you've saved me a lot of effort with these two spline videos.
@javidx97 жыл бұрын
Glad I could help Kareshi. Cheers!
@pleshw4 жыл бұрын
You are one of the best teachers i have ever had since i started college Thanks!
@RhoTrepaan6 жыл бұрын
of all the times i tried diving into splines, this (series of two) made me "get" it. Thanks :D
@javidx96 жыл бұрын
Nice one Rho, Splines can be a bit difficult, but as soon as you realise just how simple they are, you never stop using them!
@CarstenMeyer7 жыл бұрын
Very nice! I once implemented the length calculation with the same idea but my code was very ugly and unreadable. Your videos are awesome because your explanations are very clear and straight foreward. Timeless tutorial videos!
@javidx97 жыл бұрын
Hey Thanks Carsten!
@1st_ProCactus7 жыл бұрын
Awesome, I have been looking for something like this for years, I will be using some of your code and concepts in your videos for my 'too big' project. Thanks for doing this, I hope your channel gets the magic youtube boost.
@javidx97 жыл бұрын
Thank ProCactus, as long as people find it useful, and you have, then I'm happy!
@GregoryTheGr8ster5 жыл бұрын
I love watching that wireframe space ship wind and wend its way around the spline path.
@Ruxify6 жыл бұрын
I implemented a spline class in my game engine and I noticed that it was very difficult to try and get true velocity independence when sampling from the spline using the normalized percentage value t. I think this is due to samples being more concentrated around the end points of each segment and thus the velocity would fluctuate a little between each point. To solve this, I created a function in my spline class that computes a t value from a distance along the spline in world units using a binary search to find the t that is closest to the desired distance along the spline. Then to move along the spline at an independent velocity, I declare a distance variable that is incremented each frame by a velocity value which I then use to sample from the spline data using the previously mentioned function to compute the transform of whatever is traversing the spline.
@javidx96 жыл бұрын
Hi Ruxify, that's quite an interesting approach. Does it handle the spline changing in real time too?
@Ruxify6 жыл бұрын
Yes! It calculates it based on the spline's state when you call the function... though since it uses a binary search function it may be more efficient to pre-compute a linear path from the spline whenever the spline changes rather than every frame.
@robotics_and_stuff5 жыл бұрын
Found the same problem and then saw your comment. You are right! There is non-linearity in "t" regarding to the distances, so the divide operation in "GetNormalisedOffset" which intended to result the fractional "t" will be inaccurate. Binary search is good idea!
@nightwintertooth95022 жыл бұрын
I have to correct you. Although you can use linear rectification to estimate the length of a curve, you can do so while avoiding iteration with elliptic integrals. The lack of sustainable arc length for the ellipsis required the need for the elliptic integral. My research gathered quite a few matlab projects that solve for incomplete arclength in three different orders, or by using Jacobi / Jacobi Zeta in four different ways. Hunt around for moiseevigor's repository and find the computer answer to the arclength for nonclosed incomplete arcs like the hematite curve.
@GregoryTheGr8ster5 жыл бұрын
Also, you might want to use binary search to find the node & offset from a point on the spline's perimeter. Of course, this means that the nodes would have to store not only their length, but also their distance from 0.
@mikemontana74365 жыл бұрын
I really enjoy your series. Thank you for this.
@javidx95 жыл бұрын
Hi and no problem Mike!
@kks21054 жыл бұрын
Thanks for the excellent tutorial. Are there any plans to make video on B-Spline and Bezier curve ?
@CykPykMyk7 жыл бұрын
man that was awesome, very simple and clear explanation and everything done in windows console! Do you plan to make any series in OpenGL / DirectX?
@javidx97 жыл бұрын
Hey thanks Xavery. I probably will look at DirectX next year. I've used both OpenGL and DX quite a bit, and would like to talk about them, the downside is they require a lot of preparation for the viewer in terms of understanding, so I don't know if they'll fit my format - perhaps a "project" series of videos would be required. So maybe!
@CykPykMyk7 жыл бұрын
great to hear that :D
@TimothyChapman Жыл бұрын
Do a tutorial on how to implement NURBS curves.
@DavstrWrexham7 жыл бұрын
Quick question: Do you think it would be feasible to differentiate the equations again to get the acceleration? The reason for this is so that if you were modelling an aircraft or spacecraft, say, you could get the model to bank over in the turns.
@javidx97 жыл бұрын
Hi Davstr, of course you can keep differentiating! Might be worth a try once I get 3D in the console finished.
@sanosanbaby2 жыл бұрын
you might need to make some lookup map for any t for this purpose as splines are calculated once.
@TheWeepingCorpse7 жыл бұрын
i've not looked at my code for ages, but i seem to remember the kink is called an inflection point and they normally appear around t =0.25, t=0.5 and t=0.75.
@javidx97 жыл бұрын
Hi WeepingCorpse, I believe you are right.
@TheWeepingCorpse7 жыл бұрын
javidx9 I've been binge watching your channel. I keep wanting to do something like it myself but haven't plucked up the courage to go on camera lol.
@TeenNewsLive2 жыл бұрын
Did you mean to say Euclidean distance at 3:34?
@javidx92 жыл бұрын
No
@rogermichou86545 жыл бұрын
how do you split a quadratic spline into 2 subsplines please ?
@gdk8704 жыл бұрын
How would apply this to create a spline of rotations -i.e. quaternions? It would allow smoothly going from one rotation to the next, then the next, and so on.
@javidx94 жыл бұрын
The spline can exist in as many dimensions as you like, as its axis independent, so just interpolate your coefficients. Granted, with quats the output may need some tweaking to ensure continuity but it may just simply work.
@gdk8704 жыл бұрын
@@javidx9 So I scaled then added each quaternion component (w, x, y, z) with the respective coefficient -as you did in the video. I may have misunderstood your written steps above, since there's no smoothness difference from just looping the rotations through a Slerp. This leads me to hope that maybe one day you'd make a video about it -one can hope (U_U)
@BrunoPiovan6 жыл бұрын
amazing! thanks for that!
@javidx96 жыл бұрын
No problem Bruno, thanks!
@lupinedreamexpress6 жыл бұрын
I really love your 2D implimentations. They helped me learn a lot about interpolation, itself. I think they'd help a lot more if you did a Unity 3D implementation.
@javidx96 жыл бұрын
Thanks Lupine, You can easily extend this to 3D, 4D and onwards! :D, the maths is applied independent of the axis, so just add a z component in the same style as x and y.
@lupinedreamexpress6 жыл бұрын
Very nice! I love how extensible these equations are. Its fascinating.
@shoryu78912 жыл бұрын
@@javidx9 Great!! Thiss helpes me a lot!! Thank you so much!!~
@researchandbuild17515 жыл бұрын
Basically just increase the resolution of the spline for speed calculation. I wonder if this is kind of a nyquist thing. Or aliasing, essentially
@TheDyingFox4 жыл бұрын
Nice! Now fCurves makes more sense in Blender :D
@d.j.peters6 жыл бұрын
From file OneLoneCoder_Splines2.cpp if t starts in the loop with 0 then newPoint=oldPoint so the t loop must start with fStepSize float CalculateSegmentLength(int node, bool bLooped = false) { float fLength = 0.0f; float fStepSize = 0.005; sPoint2D old_point, new_point; old_point = GetSplinePoint((float)node, bLooped); for (float t = fStepSize; t < 1.0f; t += fStepSize) { new_point = GetSplinePoint((float)node + t, bLooped); fLength += sqrtf((new_point.x - old_point.x)*(new_point.x - old_point.x) + (new_point.y - old_point.y)*(new_point.y - old_point.y)); old_point = new_point; } return fLength; } DJ
@javidx96 жыл бұрын
Thanks DJ, this is a minor, but completely valid optimisation!