How to create randomly distributed triangles
Ältere Kommentare anzeigen
I need to create a moving visual display consisting of 500 randomly distributed white triangles (3.4 × 3.4 × 3 cm) on a black background. The frame rate of the visual display needs to be 60 Hz, triangles move in fore-aft direction. Could you please help me figure this out? Thank you.
10 Kommentare
Rik
am 26 Aug. 2020
What steps did you try yourself?
Also, 60 hertz is quite a lot for live generation. Matlab is not a game engine, so this will require a powerful computer. If you write a file you will have a better chance to reach 60 fps.
Rik
am 2 Sep. 2020
That is an almost imperceptible speed. Why do you want 60 Hz if your actual movement is 0.2 Hz?
Ron
am 2 Sep. 2020
Rik
am 2 Sep. 2020
If you want to create something like that I would still encourage you to produce a video, instead of creating the video in real time. The code in my answer will run at 200fps, but that will quickly drop when you put more graphics object in a figure. I also have a reasonly powerful computer, so you would have to verify the performance of your target computer.
Ron
am 2 Sep. 2020
Rik
am 2 Sep. 2020
You can write videos with Matlab. I have never done that before, so I would have to do the same as you: google 'write video Matlab'. You can produce each frame as an image and write it to a video file.
Syncing with an external device might be tricky though. That depends mostly on how that sync should work.
Ron
am 3 Sep. 2020
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Contour Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!