How to speed up surf plot for thousands of objects ?
이전 댓글 표시
I want to plot thousands of objects in 3d using surf plot. My code looks like this
% src is an m x 3 matrix. Each row is the x, y and z coordinate of an object.
[sx, sy, sz] = sphere;
for ii = 1 : length(src)
surf(sx+src(ii,1), sy+src(ii,2), sz+src(ii,3))
end
There are up to 3000 objects that I want to plot and it takes roughly 30 secs to render. I'm wondering if there is any way to speed this up? I tried very naively with parfor, which ended up with nothing at all. I'm also wondering why parfor won't work?
채택된 답변
추가 답변 (2개)
CY Y
2015년 2월 10일
1 개 추천
댓글 수: 1
David Saidman
2020년 12월 16일
That helped big time, thanks for following up
Titus Edelhofer
2015년 2월 10일
0 개 추천
Hi,
parfor won't work, because the figure you plot to is bound to the MATLAB desktop you work on. You can transfer computations to workers using parfor, not display of graphics.
Regarding the question on speed up: you might reduce complexity of each object using e.g. sphere(15) instead of the default 20 segments...
Titus
카테고리
도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!