Filter löschen
Filter löschen

how to plot a unit sphere around a 3D object ?

1 Ansicht (letzte 30 Tage)
jiji hr
jiji hr am 8 Jun. 2016
Kommentiert: jiji hr am 10 Jun. 2016
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:
Could you help me please.
  2 Kommentare
John
John am 8 Jun. 2016
Look up 'sphere' in the MATLAB documentation. It is straight forward.
jiji hr
jiji hr am 9 Jun. 2016
the problem I encounter is that how to center it on the object so that I could aligne objects acourding to this sphere with PCA,what ever its size ?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

KSSV
KSSV am 9 Jun. 2016
Bearbeitet: KSSV am 9 Jun. 2016
[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)
  1 Kommentar
jiji hr
jiji hr am 10 Jun. 2016
Actually what I was searching about is to draw the minimum bounding sphere around each object in my DB, because the matlab's sphere function is just for drawing a sphere. In the literature there is a lot of algorithms to compute the minimum bounding sphere such : Gärtner's algorithm, Welzl's algorithm, Megiddo's algorithm, Fischer's algorithm ... And fortunately I found one of these algorithm in File extchange, and here is the link : Exact minimum bounding spheres/circles I would like to thank you for these informations about sphere too, and I wanted to share these informations about minimum bounding sphere algorithm, may be it will be helpful for some one in the same situation as me.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by