Point cloud and lighting effects
8 次查看(过去 30 天)
显示 更早的评论
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
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
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 Center 和 File Exchange 中查找有关 Point Cloud Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!