I have a three-dimensional point cloud saved in a PLY file.
Taking a point (x, y, z) as the center of the sphere, I want to plot the whole point cloud, but with a sphere of radius R which contains several points of the point cloud, but not all the cloud.
The sphere shpould be quite transparent to let the points inside itself visible.
I have tried the following with no success:
% Read point cloud file
ptCloud = pcread('frame0000.ply');
% Show point cloud
pcshow(ptCloud);
hold on
% Sphere generation
[x, y, z] = sphere;
surf(x,y,z)
hold on
% Sphere centered at (3, -2, 0)
surf(x+3,y-2,z)
Doing this, I get a plot with a sphere centered at (3, -2, 0), but it takes ALL the pointcloud inside the sphere. What's more, I cannot see the point cloud as the sphere is opaque.
How can I give a specific radius to the sphere so that it only takes the points within that radius R? And, how can I make the sphere transparent but not invisible, so that the points within the sphere are visible?
I appreciate all answers! ????