Table of Contents
Scripts > Cone overlay
Script contents// Author: A. Torpy // Created: 04 Jan 2011 // exit immediately if HF is not initialised hvar pHF set pHF <GetMap "HF"> assert <map.GetWidth pHF> "Heightfield is not initialised!" // initiailise the settings int ls.x_pos_px int ls.y_pos_px int ls.radius_px float ls.height_m set ls.x_pos_px <div <map.GetWidth pHF> 2> set ls.y_pos_px <div <map.GetHeight pHF> 2> set ls.radius_px 100 set ls.height_m 1000 // edit settings UI, and exit if cancelled if <not <EditUI &ls "Enter cone settings">> return -1 endif // store a backup L3DTio_Backup.BackupMap "HF" "Apply cone to HF" 0 "view.ShowMap \"HF\"" int PEAK_MODE set PEAK_MODE 0 // 0 = cone, 1 = , 2 = sinusioid, 3 = pseudo-Gaussian int MIX_MODE set MIX_MODE 0 // 0 = add, 1 = subtract, 2 = max, 3 = min, 4 = replace, 5 = multiply map m if <not <calc.HF.GenPeakOverlay &m ls.radius_px ls.height_m PEAK_MODE>> echo "Error: cannot generate peak overlay in 'Cone overlay.zs'" return -1 endif // apply the peak if <not <calc.HF.CombineMapsEx pHF &m MIX_MODE <sub ls.x_pos_px ls.radius_px> <sub ls.y_pos_px ls.radius_px> 0 0>> echo "Error: cannot combine peak overlay with HF in 'Cone overlay.zs'" return -1 endif // refresh the heightfield view.ShowMap "HF" CommentsPosition
The position of the cone is set using the Peak type
By default, the peak added to the heightfield is a cone. You can change the peak type using the
Overlay type
By default, the peak is added to the heightfield. You can change the overlay mode using the
UndoThe script automatically creates an undo point before applying the peak. Thus, if you do not like the peak position, height or radius, you may undo the action by pressing CTRL+Z or by selecting the 'Edit→Undo' menu item. Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
|