How to create randomly distributed triangles
이전 댓글 표시
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
Rik
2020년 8월 26일
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
2020년 9월 2일
That is an almost imperceptible speed. Why do you want 60 Hz if your actual movement is 0.2 Hz?
Ron
2020년 9월 2일
Rik
2020년 9월 2일
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
2020년 9월 2일
Rik
2020년 9월 2일
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
2020년 9월 3일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Contour Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!