How to plot a 3D bounding box (with specific size) around a 3D point?

95 ビュー (過去 30 日間)
ML
ML 2016 年 5 月 26 日
コメント済み: Reana Taylor 2021 年 7 月 7 日
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.

採用された回答

KSSV
KSSV 2016 年 5 月 26 日
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 件のコメント
Sunita Saha
Sunita Saha 2018 年 2 月 14 日
After plotting the cube how to store the coordinates of the 8 vertices of the cube generated?
Reana Taylor
Reana Taylor 2021 年 7 月 7 日
Hi, did you get the answer to this?

サインインしてコメントする。

その他の回答 (2 件)

KSSV
KSSV 2016 年 5 月 26 日
You can make use of the following function: http://in.mathworks.com/matlabcentral/fileexchange/15161-plotcube
  4 件のコメント
ML
ML 2016 年 5 月 26 日
編集済み: ML 2016 年 5 月 26 日
the function plots cube but not around a center point. how should I plot a cube around a point of interest? In 2D, it's like a square areound a point which is the center of it.
changcheng qiu
changcheng qiu 2018 年 10 月 17 日
I also want to know? Can you solve it?

サインインしてコメントする。


haris shakeel
haris shakeel 2018 年 4 月 28 日
how can i get four coordinates pixels values of box through matlab

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by