The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Using TPlot3D


The usage of Plot3D is straightforward: put the component on a form, set its parameters and load the data. Thereafter the corresponding 3D surface is displayed and can be manipulated by the available methods and properties. The data of the surface is stored in the rectangular matrix GridMat. The size of the grid matrix has to be set during run-time by using its method Resize.

The 3D surface is displayed using the angles around two axes: the x-axis is horizontal and always lies in the plane of the screen (ViewAngleX), the z-axis is perpendicular to the base plane of the surface, its direction depends on the property ViewAngleX. The 3D surface can be rotate around the z-axis by setting the property ViewAngleZ. Please note that there is the special method SetViewAngles  to set the viewing angles simultaneously. The viewing angles can also be set interactively by holding down the left mouse button and moving the mouse if the property MouseAction  is set to maRotate, maRotXOnly, maRotZOnly or maRotAndZoom. Moving the mouse in horizontal direction changes the angle around the z-axis, moving it vertically affects the angle around the x-axis. The properties CentX  and CentY  determine the position of the surface plot on the screen. The property Magnification  determines the overall size of the surface plot. Similar to the rotation both the position of the plot and the magnification can be set interactively by setting the property MouseAction  either to maPan or to maZoom.

The 3D surface plot can be scaled in various ways. Please see the page on scales and axes  for further information.

The colors of the survey plot are controlled by the properties ColorLow, ColorMid, and ColorHigh . Depending on the property ColorCodingMode  the colors are created either by interpolation between the two colors ColorLow and ColorHigh (if ColorCodingMode is set to ccmTwoColors), or by interpolation between ColorLow and ColorMid, and ColorMid and ColorHigh (if ColorCodingMode is set to ccmThreeColors). The assignment of the colors to z-values is controlled by the properties ColorScaleLow  (which is assigned to ColorLow) and ColorScaleHigh  (assigned to ColorHigh). If ColorCodingMode is set to ccmThreeColors the color ColorMid is assigned to the mean of ColorScaleLow and ColorScaleHigh. The color of the surface mesh is controlled by the property ColorMesh. The mesh may be made invisible by setting the property MeshVisible  to false.

You may create screen copies of the current surface plot either in BMP or WMF format by using the methods CopyToBMP, CopyToWMF, CopyToClipBoard, and CopyToClipBoardWMF

Example: The example program plotit3d.dpr shows most of the features of TPlot3D.

Hint: The control TPlot3D may be used to create a color encoded contour plot by simply setting the rotation angles ViewAngleX and ViewAngleZ to zero values and making the mesh invisible. An example is shown below: the image at right shows the contour plot derived from the surface at left:



Last Update: 2013-May-14