
5.2 Seeking a Target - The Nature of Code
This video explores Craig Reynolds’ formula for Steering Behaviors in JavaScript (p5.js) beginning with “Seeking a Target.” Code: https://thecodingtrain.com/tracks/the-nature-of-code-2/noc/5-autonomous-agents/2-seeking-a-target
p5.js Web Editor Sketches:
🕹️ Seek: https://editor.p5js.org/codingtrain/sketches/AxuChwlgb
🕹️ Seek With Sliders (Exercise): https://editor.p5js.org/codingtrain/sketches/DROTtSI7J
🕹️ Arrive (Exercise): https://editor.p5js.org/codingtrain/sketches/dQx9oOfTN
🕹️ Pursue (Exercise): https://editor.p5js.org/codingtrain/sketches/XbsgoU_of
🎥 Previous video: https://youtu.be/P_xJMH8VvAE?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
🎥 Next video: https://youtu.be/Q4MU7pkDYmQ?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
🎥 All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
References:
🔗 Steering Behaviors for Autonomous Characters: http://www.red3d.com/cwr/steer/
Videos:
🎥 Gravitational Attraction: https://youtu.be/EpgB3cNhKPM
🎥 Angles and Vectors: https://youtu.be/oXwCVDXS2Lg
Timestamps:
0:00 Hello!
1:10 What is the desired velocity for seeking?
2:46 What is the steering force?
5:23 Let's make a Vehicle class from Particle.
6:25 Now we need a target.
6:48 Now let's add code to the seek method!
8:21 What can we do to make this feel a bit more realistic?
9:16 Adding a maximum force.
10:27 Let's do a little clean up.
11:05 What could you try next?
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
🚂 Website: http://thecodingtrain.com/
👾 Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://thecodingtrain.com/discord
✪ Nebula: https://go.nebula.tv/codingtrain
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter: https://twitter.com/thecodingtrain
📸 Instagram: https://www.instagram.com/the.coding.train/
🎥 Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
🎥 Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
🔗 p5.js: https://p5js.org
🔗 p5.js Web Editor: https://editor.p5js.org/
🔗 Processing: https://processing.org
📄 Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#forbeginners #javascript #p5js