Graph IDE ► Programming ► Perspective Scatter
The following is a complete script for programming a 3D Scatter Plot. It loads in a spiral of data and rotates the graph.
|
The general API is define in the section Graphic. The following is API description specific to the 3D Scatter Plot.
@@method(public, instance) (void)appendXValue:(double)xValue yValue:(double)yValue zValue:(double)zValue;
| |
Call like this:
Appends the x, y and z values to the list of data points for the graphic. The x, y and z values forms a 3D point. Each value must be of type double. | |
@@method(public, instance) (void)appendMarkerRed:(double)red green:(double)green blue:(double)blue alpha:(double)alpha;
| |
Call like this:
That appends the marker 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. | |
@@method(public, instance) (void)appendSegmentRed:(double)red green:(double)green blue:(double)blue alpha:(double)alpha;
| |
Call like this:
That appends the segment 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. In order for this to take effect, the scatter stroke type needs to be set to other than none. By setting some segment colors to have an alpha of 0.0, the stroke appears discontiguous. Using this method permits the 3D scatter plot to appear as a trajectory plot and when alpha is set to 0.0 for appropriate segments the trajectories appear as multiple 3D trajectories in space. | |
@@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) rotateToPhi:(double)phiAngle theta:(double)thetaAngle psi:(double)psiAngle;
| |
Call like this:
Rotates the scatter plot to the phi, theta and psi angles which are yaw, pitch and roll angles respectively in units of radians. |