update_window_pose — Modify the pose of a 3D plot.
The operator update_window_pose provides an easy way to modify the pose of the height field displayed by disp_obj if the paint mode is set to '3d_plot' using set_paint.
Two window coordinates (LastRow,LastCol) and (CurrentRow, CurrentCol) are transformed into rotation, scaling, or movement depending on Mode. This window coordinates must be provided with respect to the current image part. As a consequence, this coordinates are subpixel coordinates. Given the current image part (row1,column1,row2,column2), the upper left corner corresponds to the coordinate (row1 - 0.5, col1 - 0.5). Accordingly, the bottom right corner corresponds to the coordinate (row2 - 0.5, col2 - 0.5). Use get_mposition_sub_pix or get_mbutton_sub_pix to obtain this coordinates directly.
If Mode is set to 'rotate', the height field is rotated using a virtual trackball model. Both points are projected on a sphere centered in the center of the window WindowHandle. The circular arc between this two projections corresponds to the rotation applied to the height field.
If Mode is set to 'scale', zooming is reduced if CurrentRow is greater than LastRow and increased if CurrentRow is smaller than LastRow.
If Mode is set to 'move', the input points are projected onto the plane through the center of the height field parallel to the viewing plane. The center of the height field is moved in this plane by the distance between both projections.
If Mode is set to 'move_plane', the input points are projected on the plane given by height zero. The height field is moved in this plane by the distance between both projections.
Row coordinate of the first point.
Column coordinate of the first point.
Row coordinate of the second point.
Column coordinate of the second point.
Default value: 'rotate'
List of values: 'move', 'move_plane', 'rotate', 'scale'
* Interactive display of a height field dev_set_paint ('3d_plot') while (1) dev_set_check ('~give_error') get_mposition_sub_pix (WindowHandle, Row, Column, Button) dev_set_check ('give_error') if (ButtonDown and (Button == 0)) ButtonDown := false endif if (not(Button == 0)) if (ButtonDown) if (Button == 1) mode := 'rotate' endif if (Button == 4) mode := 'scale' endif if (Button == 5) mode := 'move' endif update_window_pose (WindowHandle, lastRow, lastCol, Row, Column, mode) else if (Button == 2) break endif ButtonDown := true endif lastCol := Column lastRow := Row endif dev_display (Image) endwhile
set_paint, open_window, get_mposition_sub_pix, get_mbutton_sub_pix