how to plot a unit sphere around a 3D object ?
3 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I am actually working on 3D objects (.obj files), and I am trying to define à unit sphere on a 3D object, but I really don't have any idea how to do it and even how to searche, I don't know if it existe on matlab or should I see an other softwar. I want to obtain something like on this image:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/165974/image.png)
Could you help me please.
2 件のコメント
回答 (1 件)
KSSV
2016 年 6 月 9 日
編集済み: KSSV
2016 年 6 月 9 日
[x,y,z] = sphere ;
surf(x,y,z) ;
Generates the sphere with origin as center. If you want the center of sphere at [x1,y1,z1], (your desired center, which will be at half the length of your object) just add this point to [x,y,z].
[x,y,z] = sphere ;
xnew = x+x1 ; ynew = y+y1; znew = z+z1 ; % shift the origin to [x1,y1,z1]
surf(xnew,ynew,znew)
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!