Graph IDE ► Programming ► Perspective Surface
The following is a complete script for programming a 3D Surface Plot. It loads a wavy surface made from 10,000 z-values on a square grid.
|
The general API is define in the section Graphic. The following is API description specific to the 3D Surface Plot.
@@method(public, instance) (void) setGridXLength:(unsigned)xLength xMinimum:(double)xMinimum xMaximum:(double)xMaximum yLength:(unsigned)yLength yMinimum:(double)yMinimum yMaximum:(double)yMaximum;
| |
Call like this:
Sets the grid parameters. Since the grid is rectangular and uniform these are the only parameters needed to specify the grid. | |
@@method(public, instance) (void) appendValue:(double)aValue;
| |
Call like this:
Appends zValue to the list of surface values. Each value must be of type double. The number of zValues appended should equal the grid x-length time y-length. | |
@@method(public, instance) (void)emptyData;
| |
Call like this:
Removes (empties) all data from the graphic. Call this right before adding new data points. | |
@@method(public, instance) (void)appendFalseRed:(double)red green:(double)green blue:(double)blue alpha:(double)alpha;
| |
Call like this:
That appends the half-cell color to the red, green, blue and alpha values of 0.5, 0.4, 1.0 and 1.0 respectively. Those values must be between 0.0 and 1.0. An alpha of 0.0 is transparent while 1.0 is completely opaque. Each argument must be a number literal or a variable (or expression) of type double. Note that this call must accompany a appendXValue:xValue yValue: call in order to synchronize the parameters that depend upon sequence index. Note: A cell is defined by four adjacent points on the x-y grid. That cell is divided by a diagonal thus making two triangular regions. You should call this method twice with the same color to fill in the entire rectangular cell when making such false color maps. | |
@@method(public, instance) (void) rotateToPhi:(double)phiAngle theta:(double)thetaAngle psi:(double)psiAngle;
| |
Call like this:
Rotates the surface plot to the phi, theta and psi angles which are yaw, pitch and roll angles respectively in units of radians. |