How to get xyz coordinates of a 3d object
14 views (last 30 days)
Show older comments
I need to get the xyz coordinate points of a 3d object that I've loaded in MATLAB.
So far, I've been able to load the .stl file and I can already rotate it. The part I'm having trouble in is getting the xyz coordinates of the object before rotating it.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149309/image.png)
Basically, what I need is to get the xyz coordinate points in that blue line, rotate it, and then get the xyz coordinates again, and so on, and so forth until I got all the xyz coordinates of the 3d object.
Is it possible to do this? And can anyone point me in the right direction?
I'm sorry because I'm fairly new to Matlab and 3d processing.
Thanks in advance!
6 Comments
Walter Roberson
on 22 Sep 2015
I am known by many names but Matthew is not one of them ;)
I will need to think about an implementation. Are the faces all in a consistent "handedness" that allow you to know which way is inside? Consistent orientation is needed for proper lighting so they might be in consistent order in the model file. Consistent order allows some linear algebra approaches to determine whether a given point is inside or outside.
Answers (2)
Walter Roberson
on 22 Sep 2015
So create a cubiod grid of the x and y points you want to test together with z sampled over a fine enough interval for your purpose. Then put the grid through the above routine along with the geometry. This will voxelize the geometry into binary inside or outside test. Then for any given row and column indices the positions where the third dimension is true are the coordinates you are looking for.
Anandh
on 21 Jun 2019
Hi, I need a help. I have a 3D MRI data. I want to get the x,y,z coordinate matrices of the data. Can you please help me?
Thanks in advance!
Anandh.
0 Comments
See Also
Categories
Find more on Visual Exploration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!