Live Stream #18

TL;DR
Learn how to create objects in Processing and p5.js that store a history of their movements and how to record your creations as video files.
Transcript
in New York hello hello how does the focus okay check your chat voice not good okay one's gonna send the voices not good anyone here I'm going to the hole for a second because when we go too far for audio it's not good if you're watching this in the archives on ticket in 30 seconds yes the voice on the cracker okay let me see what I can do about th... Read More
Key Insights
- 🏪 By storing an object's path as an array, you can draw a trail for the object.
- 📌 The push() function is used to add new entries to an array, such as the object's current location.
- 📁 The saveFrame() function allows you to save each frame of your animation as an image file, which can then be compiled into a video file.
Install to Summarize YouTube Videos and Get Transcripts
Explore YouTube Video Summarizer or Get YouTube Transcript Extractor
Questions & Answers
Q: How can I make an object in Processing store its path as it moves around the screen?
You can create an object with x and y coordinates and an array called history. In the object's update function, use the push() function to add the current x and y values to the history array.
Q: Can I erase the background while still maintaining the object's path?
Yes, you can use the background() function to erase the background, but you'll need to draw the object and its trail in each frame to make sure they are displayed.
Q: How can I limit the length of the object's path?
You can use an if statement to check if the history array's length exceeds a certain value. If it does, you can use the splice() function to remove the oldest entry and keep the array at a desired length.
Q: How can I record my creations as video files?
You can use the saveFrame() or save() functions in Processing to save each frame of your animation as an image file. Then, you can use software like After Effects or the processing moviemaker tool to compile the images into a video file.
Summary & Key Takeaways
-
This video tutorial demonstrates how to create objects in Processing and p5.js that move around the screen and store a history of their paths.
-
By using arrays and the push() function, the objects can store their previous locations and draw a trail for themselves.
-
The tutorial also shows how to record these creations as video files, which can be useful for uploading to websites or incorporating into other projects.
Read in Other Languages (beta)
Share This Summary 📚
Summarize YouTube Videos and Get Video Transcripts with 1-Click
Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator
Explore More Summaries from The Coding Train 📚






Summarize YouTube Videos and Get Video Transcripts with 1-Click
Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator