Point cloud and lighting effects

조회 수: 7 (최근 30일)
Richard
Richard 2017년 10월 7일
편집: Cedric 2017년 10월 14일
I'm displaying a half a dozen point clouds, and would like to add some "effects", eg lighting, etc. to give some depth to the figure. But, I don't seem to be able to get any lighting to reflect off the point cloud. Is there any way to do that? The figure seems "flat" without some sort of shadow effect.
Thanks Rick
  댓글 수: 2
Abhi Sundararaman
Abhi Sundararaman 2017년 10월 10일
There's a light function
However, it says that lighting only affects patches and surfaces. If you mapped your point cloud onto a surface or a patch, I suppose you could also use the above function.
Another thing you could do is, if the point clouds are being displayed as a scattered set of points in 3d, you could plot the same points again but zero one of the components of X,Y, and Z and plot those points in black. This would fake a "shadow" effect (for example if you zeroed Z).
Cedric
Cedric 2017년 10월 10일
편집: Cedric 2017년 10월 14일
And here is a pretty scary alternative ..
pts = rand( 20, 3 ) * 10 ;
plot3( pts(:,1), pts(:,2), pts(:,3), 'r.', 'MarkerSize', 15 ) ;
hold on ; grid on ;
R = @(ry,rz) [cos(ry) -sin(ry) 0; sin(ry) cos(ry) 0; 0 0 1] * ...
[cos(rz) 0 sin(rz); 0 1 0; -sin(rz) 0 cos(rz)] ;
p = [zeros(1,8); 0,0.5,0.2,0.6,0,0.1,0,0; 0,1,1,2,2,1,1,0] ;
for k = 1 : 10
rts_p = R(rand-0.5,rand-0.5)*(rand+0.5)*eye(3)*p+rand(3,1).*max(pts).' ;
fill3(rts_p(1,:),rts_p(2,:),rts_p(3,:), 'y') ;
end

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by