Sliding Something Along a Line in Godot (Dot Product Math)

Channel:
Subscribers:
3,830
Published on ● Video Link: https://www.youtube.com/watch?v=AI4NYfEKpc4



Duration: 12:03
1,170 views
49


Today we learn how to use the dot product to clamp something along a line :)

Maxdot product explanation:
The maxdot variable is to find the end of the line, essentially the value we want to clamp to, if you try the code out locally, and change what values you use for maxdot, smaller values will have the follower move a small distance, while larger values have the follower moving wayyyy past the end of the line

Code:
https://github.com/aimforbigfoot/NAD-LAB-Godot-Projects/tree/master/TriangleProject


0:00 - Intro
0:53 - Dot Product Exlpanation on Youtube
1:29 - My Dot Product Explanation
4:00 - Scene Setup (not that important)
4:55 - Line setup (not that important)
5:55 - Dot Product Code (important)
6:51 - Max Dot Product
6:55 - Dot Product Code Cont'd (important)
11:31 - Conclusion


For the Godot Icon used in the thumbnail: Original Author of the Godot Icon (Andrea Calabró), changes were made to this icon.
https://commons.wikimedia.org/wiki/File:Godot_icon.svg







Tags:
Godot
Dot Product
Math