Re: Check Snap Orientation with if condition
Posted: November 6th, 2022, 8:24 pm
Well thanks, that works brilliantly and reduces the code quite a bit.balala wrote: ↑November 6th, 2022, 8:13 pm An improvement of the code: I replaced the [MeasureTangent] measure with the following [MeasureOrientation]. This measure returns a number which represents the number of degrees from the upper vertical line (drawn from the center of the screen to the center of its upper edge) to the line drawn from the center of the screen to the center of the skin, as shown below:
Degree.png
Having this number, you can extremely easily create the proper IfConditions to get the desired result. Hope you got how...
The code of the measure (only the measure, with no other sections and no IfConditions):Code: Select all
[MeasureOrientation] Measure=Calc Formula=(( 360 + Deg ( Atan2 (( #WORKAREAWIDTH# / 2 - ( #CURRENTCONFIGX# + #CURRENTCONFIGWIDTH# / 2 )), ( #WORKAREAHEIGHT# / 2 - ( #CURRENTCONFIGY# + #CURRENTCONFIGHEIGHT# / 2 ))))) % 360 ) DynamicVariables=1