![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172202/image.png)
How to generate a point cloud in 3D?
6 次查看(过去 30 天)
显示 更早的评论
Hello dear community,
I would like to know if there is a fast way to create a cloud in 3D which consists of points. I would like to get something like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/151796/image.jpeg)
The points should be written into a simple matrix. Each row should represent one point. Thank you for your help!
0 个评论
采纳的回答
Mike Garrity
2015-11-16
编辑:Mike Garrity
2015-11-16
This might be a good starting point:
[x,y,z] = ndgrid(1:5:100,1:5:100,1:5:100);
scatter3(x(:),y(:),z(:),'.')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172202/image.png)
The ndgrid function will return multiple arrays of the same shape with one of its inputs replicated along one dimension of each of its outputs.
The syntax x(:) says to convert that 3D array into a vector.
The scatter3 function takes 3 vectors and plots a marker at the location defined by each row of the three.
The '.' argument to scatter3 tells it to draw a dot, rather than one of the bigger and more complex markers.
6 个评论
Halil Bölük
2020-4-30
Hello RAMYA. I need stl to point cloud transformation. Did you find anything about this ?
elnaz gh
2020-9-14
Hello you can use meshlabjs(it is online) and upload yor .stl file and then search "sampling" then select poission disk sampling or monto carlo sampling,
更多回答(1 个)
faten emad
2018-9-17
Hi Mike, your code is very good. I want to generate a point cloud of moving scan camera can you help me?
5 个评论
另请参阅
类别
在 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!