How to create randomly distributed triangles
Mostrar comentarios más antiguos
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 comentarios
Rik
el 26 de Ag. de 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
el 2 de Sept. de 2020
That is an almost imperceptible speed. Why do you want 60 Hz if your actual movement is 0.2 Hz?
Ron
el 2 de Sept. de 2020
Rik
el 2 de Sept. de 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
el 2 de Sept. de 2020
Rik
el 2 de Sept. de 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
el 3 de Sept. de 2020
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Contour Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!