Рет қаралды 38,433
This video covers the dot product and scalar projection with p5.js and vectors, concepts that I’ll need for finding the distance between a point and a line which will lead to the path following steering behavior in the next video! Code: thecodingtrain.com/tracks/the...
p5.js Web Editor Sketches:
🕹️ Angle Between: editor.p5js.org/codingtrain/s...
🕹️ Scalar Projection: editor.p5js.org/codingtrain/s...
🎥 Previous video: • 5.5 Wander Steering Be...
🎥 Next video: • 5.7 Path Following (St...
🎥 All videos: • The Nature of Code 2
References:
🔗 Path Following: editor.p5js.org/natureofcode/...
🔗 Steering Behaviors for Autonomous Characters: www.red3d.com/cwr/steer/
🔗 Scalar Projection: en.wikipedia.org/wiki/Scalar_...
🔗 Vector Projection: en.wikipedia.org/wiki/Vector_...
Videos:
🎥 3D Rendering with Rotation and Projection: • Coding Challenge #112:...
🎥 Unit Vector (Normalize): • 1.5 A Unit Vector (Nor...
🎥 Dot products and duality: • Dot products and duali...
Timestamps:
0:00 Welcome! What are we looking at today?
1:01 What is scalar projection?
3:04 How do we use dot product to find the scalar projection?
6:13 Let's create a scalarProjection() function.
8:01 Modifying the function to be vectorProjection().
9:42 How is this useful for path following?
11:39 Let's see if it works for finding a point on a path?
13:04 Thanks for watching! See you in the next video about path following.
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
🚂 Website: thecodingtrain.com/
👾 Share Your Creation! thecodingtrain.com/guides/pas...
🚩 Suggest Topics: github.com/CodingTrain/Sugges...
💡 GitHub: github.com/CodingTrain
💬 Discord: thecodingtrain.com/discord
✪ Nebula: go.nebula.tv/codingtrain
💖 Membership: kzfaq.infojoin
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: / thecodingtrain
📸 Instagram: / the.coding.train
🎥 Coding Challenges: • Coding Challenges
🎥 Intro to Programming: • Start learning here!
🔗 p5.js: p5js.org
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
#forbeginners #javascript #p5js