SPHERE_XYZF_DISPLAY
Display Unit Sphere + 3D Points + Faces
in the 3D MATLAB Graphics Window


SPHERE_XYZF_DISPLAY is a MATLAB program which reads information identifying an XYZ data file containing a list of 3D point coordinates and an XYZF file listing point indices that form faces, and displays a unit sphere, the points, and the faces, in a 3D MATLAB graphics window.

It is difficult to visualize points and faces that lie on the unit sphere. You can't see the curving surface, and you can see points and faces that should not be visible, because they are on the other side of the sphere. By starting the display with a unit sphere, and then adding the 3D points and faces you want to see, both of these problems are resolved. The addition of the sphere gives important visual cues as to how to "read" the data.

The files containing the point coordinates and the face indices are in the XYZ and XYZF formats respectively. The MATLAB command patch is used to display the faces, and plot3 displays the points. The sphere is generated by the sphere command and displayed with the surf command.

SPHERE_XYZF_DISPLAY is essentially a version of XYZF_DISPLAY with the addition of a displayed sphere. It seems like a small change, but for spherical point data, it makes a huge difference.

Usage:

sphere_xyzf_display ( 'prefix' )
where and displays a plot of the points and faces.

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Related Data and Programs:

BALL_AND_STICK_DISPLAY, a MATLAB program which demonstrates the creation of a 3D "ball and stick" image;

MPAS_GRID_DISPLAY, a directory of MATLAB programs which can read an MPAS NETCDF grid file and display the primary polygonal mesh or the dual triangular mesh.

QUAD_SURFACE_DISPLAY a MATLAB program which reads files defining a 3D quadrilateral mesh surface and displays it within MATLAB.

SPHERE_CVT is a MATLAB library which creates a mesh of well-separated points on a unit sphere by applying the Centroidal Voronoi Tessellation (CVT) iteration.

SPHERE_DELAUNAY, a MATLAB program which computes the Delaunay triangulation of points on a sphere.

SPHERE_DESIGN_RULE is a FORTRAN90 library which returns point sets on the surface of the unit sphere, known as "designs", which can be useful for estimating integrals on the surface, among other uses.

SPHERE_GRID, a dataset directory which contains grids of points, lines, triangles or quadrilaterals on a sphere;

SPHERE_GRID, a MATLAB library which provides a number of ways of generating grids of points, or of points and lines, or of points and lines and faces, over the unit sphere.

SPHERE_VORONOI, a MATLAB program which computes the Voronoi diagram of points on a sphere.

SPHERE_VORONOI_DISPLAY_OPENGL, a C++ program which displays a sphere and randomly selected generator points, and then gradually colors in points in the sphere that are closest to each generator.

SPHERE_XYZ_DISPLAY is a MATLAB program which reads XYZ information defining points in 3D, and displays a unit sphere and the points in the MATLAB graphics window.

SPHERE_XYZ_DISPLAY_OPENGL a C++ program which reads XYZ information defining points in 3D, and displays a unit sphere and the points, using OpenGL.

TRI_SURFACE_DISPLAY is a MATLAB program which reads data defining a triangular mesh of a 3D surface and displays it.

XYZF_DISPLAY is a MATLAB program which reads XYZF information defining points and faces in 3D, and displays an image using OpenGL.

XYZF_DISPLAY_OPENGL a C++ program which reads XYZF information defining points and faces in 3D, and displays an image using OpenGL.

Source Code:

Examples and Tests:

FRED is a pair of files containing the coordinates of 252 points and the triples of indices that form 500 triangular faces.

You can go up one level to the MATLAB source codes.


Last revised on 31 August 2010.