File Exchange

image thumbnail


version (3.96 KB) by James Ramm
Plots upper and lower surfaces of a layer, calculates and plots the boundary faces


Updated 21 Jun 2010

View License

Intended for 3D geological/geophysical visualisation of layered data and will eventually form part of a geophysical visualisation package.
Run ThreedDemo to get an idea of how to use.

INPUTS: LayerN: The number of the layer to be plotted
R: a m*n*k matrix of colour/resistivity data for each layer where
m*n is the size
of the grid and k is the layer number
Z: a m*n*k+1 matrix of elevation data for each layer. Therefore
Z(:,:,1) gives the topography of the land, Z(:,:,2) would be the
topography of the interface between layer 1 and layer 2.
Z(:,:,k+1) gives the topography of the base of the last layer.
Xn, Yn: m*n matrices of the base grid containing the XY co-ords
for each point.

NOTE: Each matrix must be surrounded by NaNs. This could be
achieved in two ways: 1. Use the NaNMat function
2. Plot a pcolor image of the surface
and use ginput to draw a polygon of
the desired surface. Then use
'inpolygon' to replace all those
values lying outside with NaN. See
the file ThreedDemo for help.

OUTPUTS: hLight: handle of the light object for manipulating lighting.

Has been tested on large data sets (10000 points). Uses opengl for rendering, but this can easily be changed.

Cite As

James Ramm (2020). Surf3D (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)


21/06/10 Fixed bug in NanMat.m

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux