Element: Surface.

Icon: 

Text: A 3D surface.

Description: A Surface is a drawing element that displays a three-dimensional surface of the form (x,y,z) = (x(u,v),y(u,v),z(u,v)). The vertex points of the surface are given by a three-dimensional array, as in:

for (int i=0; i<n; i++) {
  for (int j=0; j<m; j++) {
    data[i][j][0] = -3.14 + (6.28*i)/(n-1);
    data[i][j][1] = -3.14 + (6.28*j)/(m-1); 
    data[i][j][2] = Math.sin(data[i][j][0])*Math.cos(data[i][j][1]);
  }
}

where n and m have the value of 15 and data has been declared as an array of size [n][m][3]. The result is displayed in the image below.

The surface can be moved by dragging any of its vertex points, invoking up to three different actions.

Advanced Color Scheme

This element allows the use of an advanced color scheme for it. The user can define an origin and a direction in space so that the distance from the origin along this direction decides the color that will be used to fill the interior of the element. This can produce drawings like the one displayed below.

Table of properties

Name Description Values accepted
Position and Size
Origin X The X coordinate of the base position of the element. Any constant or variable of type double or int.
Origin Y The Y coordinate of the base position of the element. Any constant or variable of type double or int.
Origin Z The Z coordinate of the base position of the element. Any constant or variable of type double or int.
Size X The size of the element in the X direction. Any constant or variable of type double or int.
Size Y The size of the element in the Y direction. Any constant or variable of type double or int.
Size Z The size of the element in the Z direction. Any constant or variable of type double or int.

Visibility and Interaction

Visible The visibility of the element. A boolean variable or one of the constants true or false.
Enabled Whether the element moves when the user drags its points. A boolean variable or one of the constants true or false.
On Press The action to invoke when the element is pressed. The Java code to invoke for the action. 
On Drag The action to invoke when the element is moved. The Java code to invoke for the action. 
On Release The action to invoke when the element is released. The Java code to invoke for the action. 
On Enter The action to invoke when the pointer enters the element. The Java code to invoke for the action. 
On Exit The action to invoke when the pointer leaves the element. The Java code to invoke for the action. 
Configuration
Data The array of data for the vertex points of the element. A three-dimensional [n][m][3] array of type double.
Graphical Aspect
Fill Color The color used to fill the element. The special value null draws an empty element. An Object variable of the class java.awt.Color or one of the predefined colors: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, white, yellow.

A color can also be specified providing its integer RGB coordinates (between 0 and 255), plus an optional transparency coordinate.

The default value is decided by the system.

Line Color The color used for the lines of the element. The special value null draws the element without an edge. See the values for the Fill Color property.
Stroke The thickness for the lines of the element. Any constant or variable of type double or int. The default value is 1.

Object variables of the class  java.awt.Stroke are also accepted.

Displacement This is a factor that allows us to simulate that the element is located further from the observer than it actually is. This allows a better visualization of other elements that move along the surface This factor is set ussually to a value slightly bigger that one, such as 1.1. Any constant or variable of type double. The default value is 1.
Quick Transp The level of transparency to use when the surface is drawn quickly (which can happen when the scene is rotated). Any constant or variable of type int.

The value must be in the range from 0 (transparent) to 255 (solid).

Advanced Color Scheme
Color Origin Defines the origin point for the computation of the color levels. A one-dimensional array of type double with three elements. One for each of the coordinates of the origin point.
Color Direction Defines the direction along which the gradient of colors takes place. A one-dimensional array of type double with three elements. One for each of the coordinates of the gradient of colors.
Color Levels Defines the number of levels that separate the zones with the same color. The number of levels must be one less than the number of colors. A one-dimensional array of type double providing the values for which a change of color takes place.
Color Fills Defines the colors to use at each side of the color leves. The number of colors must be one more than the number of levels. A one-dimensional array of type Object. Each element in the array must be the color to use in each of the zones delimited by the levels.

For the accepted values for the elements in the array, see the values for the Fill Color property. 

Threshold Below Whether to use the color of the level below for points right in the level of separation of two color zones. A boolean variable or one of the constants true or false.