Search code examples
matlabgeometrysurf

How to draw Geosphere in matlab?


How to draw a Geosphere in matlab?

By Geosphere I mean the way of discretization points on a sphere (Geosphere is, for example in 3Ds Max).

On the image below, it is shown Sphere (on the left) and Geosphere (on the right) enter image description here

In Matlab there is a function sphere, which gives such a result: enter image description here

I need to get such an image of a Geosphere. I have a matrix Nx3, with xyz coordinates of every point of Geosphere.

UPDATE:

I had problem only with displaying (drawing) geosphere, because I already have data - xyz coordinates of every point. Thats why Gunther Struyf's answer helped me and I accepted it.

This I got with such way of displaying: (Geosphere of factor = 6, N=362) enter image description here

How to get 3d points of geosphere? I used free library SPHERE_GRID to get points of 3d-sphere. (In library there are different ways of discretization sphere).

Also, for calculating points of Geosphere, thanks @Rody Oldenhuis for answer below.


Solution

  • If you already have the points, I think you can use the same solution as here:

    tri = convhull(xyz);
    trisurf(tri,xyz(:,1),xyz(:,2),xyz(:,3));