SURFACE_LINK
This element connects a surface to another one. This means than whenever the 'from' surface changes, the 'to' surface takes the 'from' surface value.
Attributes brief detailed show all inherited
| Name | Description | Default | |||
|---|---|---|---|---|---|
| from | Identifier of the origin surface | empty | |||
| to | Identifier of the target surface | empty | |||
| enabled | Enables or disables the link | 'true' | |||
| Common attributes | |||||
| id | Identifier of the element | empty | |||
Example
Here we create a new SURFACE and link it to another surface.

- <!-- The formula that defines the surface -->
- <FORMULA_SURFACE id="source_surface" formula="cos(y*x)*demo_param" x_min="-4" x_max="4" x_default="0" y_min="-4" y_max="4" y_default="0" z_min="-1" z_max="1" z_default="0"/>
- <!-- the new surface that copies the part of another surface -->
- <SURFACE id="target_surface" x_default="0" x_min="0" x_max="4" x_unit="" y_default="0" y_min="0" y_max="4" y_unit="" z_default="0" z_max="1" z_min="0" z_unit="" />
- <!-- link (copy) one surface to another -->
- <SURFACE_LINK id="demo_surface_link" from="source_surface" to="target_surface" enabled="true" />
- <!-- The 3D View -->
- <VIEW_3D id="my_3d_view" width="400" height="200" x_ratio="1" y_ratio="1" z_ratio="0.5" transform.tx="0.0" transform.ty="0.1" transform.tz="-1.7" transform.rx="45" transform.ry="0" transform.rz="-30" cursor="system::open_hand" persistent_viewpoint="false">
- <!-- Grid object for the original surface -->
- <GRID_3D x_param_info_id="source_surface.x_info" y_param_info_id="source_surface.y_info" z_param_info_id="source_surface.z_info" y_positions_count="11" x_positions_count="11" z_positions_count="11" x_position="-1" y_position="-0.5" z_position="-0.5" opacity="0.3" />
- <!-- The original surface-->
- <COLOR_SURFACE_3D surface_id="source_surface" visible="true" draw_style="solid" high_color="#ff0000" low_color="#000030" opacity=".8" x_positions_count="100" y_positions_count="100" x_position="-1" y_position="-.5" z_position="-.5"/>
- <!-- Grid object for the target (copied/linked) surface -->
- <GRID_3D x_param_info_id="target_surface.x_info" y_param_info_id="target_surface.y_info" z_param_info_id="target_surface.z_info" y_positions_count="5" x_positions_count="5" z_positions_count="11" x_position=".2" y_position="-0.5" z_position="-0.5" opacity="0.3" />
- <!-- The copied/linked surface-->
- <COLOR_SURFACE_3D surface_id="target_surface" visible="true" draw_style="solid" high_color="#ff0000" low_color="#000030" opacity=".8" x_positions_count="100" y_positions_count="100" x_position=".2" y_position="-.5" z_position="-.5"/>
- </VIEW_3D>
- <!-- control to enable/disable the link -->
- <PARAM_TEXT_CONTROL param_id="demo_surface_link.enabled" content="Link: {text_value}" />
- <!-- demo logic to change the surface -->
- <PARAM id="demo_param" min="-3" max="5" default="0" />
- <SCRIPT script="double delta = 0.01;" />
- <TIMER id="forever_timer" refresh_time_ms="5" />
- <ACTION_TRIGGER event_id="forever_timer.elapsed"
- script="
- demo_param += delta;
- if (demo_param >=1 ) delta = -delta;
- if (demo_param <=-1 ) delta = -delta;
- " requires="demo_param;demo_param;" />
Related elements
Also see SURFACE, FORMULA_SURFACE, SURFACE_FROM_CURVE_OVER_TIME, VIEW_3D, GRID_3D, COLOR_SURFACE_3D, GL_OBJECT_3D.
Comments
Please, authorize to view and post comments.