SURFACE_FROM_CURVE_OVER_TIME
This element can be used to create custom surfaces based on the variations of an existing curve: the surface represents the evolution of the curve over time.
Attributes brief detailed show all inherited
Examples
The following example creates a surface sampling the curve every 10 ms for 10 seconds:

- <!-- formula curve -->
- <FORMULA_CURVE id="curve_demo" x_min="-10" x_max="10" x_default="0" y_default="0" y_max="1" y_min="0" formula="tanh(demo_param*(x*x*0.01))" />
- <!-- display the curve on a graph -->
- <PNS_LCD_GROUP_BOX>
- <!-- first graph for the line (stroke) -->
- <CURVE_GRAPH curve_id="curve_demo" width="300" height="150" color="#327ca3" graph_style="stroke" opacity="1" line_width="4" />
- <!-- second line for the opaque bargraph -->
- <CURVE_GRAPH curve_id="curve_demo" width="300" height="150" color="#327ca3" graph_style="bargraph" opacity="0.2" line_width="4" />
- </LAYER_STACK>
- </PNS_LCD_GROUP_BOX>
- <!-- demo logic to change the curve -->
- <PARAM id="demo_param" min="-3" max="5" default="0" />
- <SCRIPT script="double delta = 0.04;" />
- <TIMER id="forever_timer" refresh_time_ms="5" />
- <ACTION_TRIGGER event_id="forever_timer.elapsed"
- script="
- demo_param += delta;
- if (demo_param >=4 ) delta = -delta;
- if (demo_param <=-2 ) delta = -delta;
- " requires="demo_param;demo_param;" />
- <!-- create surface from that curve -->
- <SURFACE_FROM_CURVE_OVER_TIME id="demo_surface" curve_id="curve_demo" duration_ms="10000" refresh_time_ms="10" />
- <!-- The 3D View -->
- <VIEW_3D id="my_3d_view" width="310" height="150" x_ratio="2.5" y_ratio="1" z_ratio="0.5" transform.tx="0.0" transform.ty="0.0" transform.tz="-1.7" transform.rx="60" transform.ry="0" transform.rz="-50" cursor="system::open_hand" persistent_viewpoint="false">
- <!-- Grid object -->
- <GRID_3D id="my_3d_view.grid" x_param_info_id="demo_surface.x_info" y_param_info_id="demo_surface.y_info" z_param_info_id="demo_surface.z_info" y_positions_count="11" x_positions_count="11" z_positions_count="11" x_position="-0.5" y_position="-0.5" z_position="-0.5" opacity="0.3" />
- <!-- The Color surface-->
- <COLOR_SURFACE_3D id="my_3d_view.surface" surface_id="demo_surface" visible="true" draw_style="solid" high_color="#ff0000" low_color="#000030" opacity=".8" x_positions_count="100" y_positions_count="100" x_position="-.5" y_position="-.5" z_position="-.5"/>
- </VIEW_3D>
Related elements
See CURVE_GRAPH, FORMULA_CURVE, VIEW_3D, COLOR_SURFACE_3D, CANVAS.
Comments
Please, authorize to view and post comments.