How to plot a 3D bounding box (with specific size) around a 3D point?
127 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How can I plot a specific size 3D bounding box (cube) around a 3D point? For example, the coordinate of the point is (10,5,10) and I need to draw a 3D bounding box size 20 (20x20x20) around the point such that the point is in the center (inside) of the 3D box.
0 commentaires
Réponse acceptée
KSSV
le 26 Mai 2016
P = [10,5,10] ; % you center point
L = [20,20,20] ; % your cube dimensions
O = P-L/2 ; % Get the origin of cube so that P is at center
plotcube(L,O,.8,[1 0 0]); % use function plotcube
hold on
plot3(P(1),P(2),P(3),'*k')
2 commentaires
Sunita Saha
le 14 Fév 2018
After plotting the cube how to store the coordinates of the 8 vertices of the cube generated?
Plus de réponses (2)
KSSV
le 26 Mai 2016
You can make use of the following function: http://in.mathworks.com/matlabcentral/fileexchange/15161-plotcube
4 commentaires
haris shakeel
le 28 Avr 2018
how can i get four coordinates pixels values of box through matlab
0 commentaires
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!