BALL_AND_STICK_DISPLAY is a MATLAB program which illustrates the use of MATLAB's 3D plotting capability to make a "ball and stick" plot.
MATLAB has many procedures for displaying numeric data in 3D using contours, vector plots, surfaces and so on. However, sometimes an illustrator needs to construct a simple 3D image of points and lines. Since the thing has to show up as an illustration or a slide, the points are exaggerated to balls, and the lines to sticks.
MATLAB's plot3 command can create both kinds of objects, but it helps to know how to specify the desired object properties for color and size. The MATLAB help system is not very helpful when trying to find out what properties you can specify and what values they can have.
So this program may be a helpful example of how a 3D object can be created with knobby balls and colored sticks.
The particular object created here is intended to illustrate the Lax-Wendroff scheme for approximating the solution of a hyperbolic partial differential equation. The blue spheres represent points at which data is known. The green spheres represent points at which fluxes are estimated by computing differences between neighboring values. The red sphere is the locationi of the updated solution value.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
BEZIER_SURFACE_DISPLAY, a MATLAB program which displays a Bezier surface;
GRID_DISPLAY, a MATLAB library which can display a 2D or 3D grid or sparse grid.
OBJ_DISPLAY, a MATLAB program which reads an OBJ 3D graphics file and displays it on the screen.
PLY_DISPLAY, a MATLAB program which displays an image of a 3D graphics file in PLY format;
POLYGONAL_SURFACE_DISPLAY, a MATLAB program which displays a surface in 3D described as a set of polygons;
QUAD_SURFACE_DISPLAY, a MATLAB program which plots piecewise bilinear data associated with a QUAD_SURFACE, that is, a 3D surface defined by a quadrilateral mesh;
STLA_DISPLAY, a MATLAB program which reads an ASCII STL file and displays it on the screen.
TET_MESH_DISPLAY, a MATLAB program which reads in the node and tetra files defining a tet mesh and displays a wireframe image.
TRI_SURFACE_DISPLAY, a MATLAB program which displays the 3D graphics information in a TRI_SURFACE file;
XYZ_DISPLAY, a MATLAB program which reads XYZ information defining points in 3D, and displays an image in the MATLAB graphics window.
XYZF_DISPLAY, a MATLAB program which reads XYZF information defining points and faces in 3D, and displays an image using OpenGL.
XYZL_DISPLAY, a MATLAB program which reads XYZL information defining points and lines in 3D, and displays an image in a MATLAB graphics window.
BALL_AND_STICK_DISPLAY displays a ball and stick plot.
FIRST_ORDER_DISPLAY displays a sequence of 8 images illustrating a first order method for dealing with hyperbolic equations. Hitting RETURN proceeds to the next image.
LAX_WENDROFF_1D_DISPLAY displays a sequence of images illustrating the Lax-Wendroff method in 1D. Hitting RETURN proceeds to the next image.
LAX_WENDROFF_2D_DISPLAY displays a sequence of images illustrating the Lax-Wendroff method in 2D. Hitting RETURN proceeds to the next image.
You can go up one level to the MATLAB source codes.