First acceptable implementation of geometry distortion and crop

Fixed shape node and crop, added rounding corner.
This commit is contained in:
Bruno Herbelin
2023-12-17 23:30:41 +01:00
parent 53bd7d6ae2
commit 5465a45dc6
11 changed files with 536 additions and 375 deletions

View File

@@ -548,6 +548,7 @@ set(VMIX_RSC_FILES
./rsc/mesh/border_handles_lock_open.ply
./rsc/mesh/border_handles_shadow.ply
./rsc/mesh/border_handles_arrows.ply
./rsc/mesh/border_handles_roundcorner.ply
./rsc/mesh/border_large_sharp.ply
./rsc/mesh/border_vertical_overlay.ply
./rsc/mesh/perspective_layer.ply

View File

@@ -1,315 +1,21 @@
ply
format ascii 1.0
comment Created by Blender 3.6.2 - www.blender.org
element vertex 152
element vertex 6
property float x
property float y
property float z
property float nx
property float ny
property float nz
element face 150
element face 2
property list uchar uint vertex_indices
end_header
-0.054269 0.035526 0.000000 0.000000 0.000000 1.000000
-0.051133 0.035460 0.000000 0.000000 0.000000 1.000000
-0.052691 0.035643 0.000000 0.000000 0.000000 1.000000
0.051265 0.035437 0.000000 0.000000 0.000000 1.000000
0.054401 0.035503 0.000000 0.000000 0.000000 1.000000
0.052822 0.035620 0.000000 0.000000 0.000000 1.000000
-0.055825 0.035091 0.000000 0.000000 0.000000 1.000000
0.055957 0.035068 0.000000 0.000000 0.000000 1.000000
-0.049640 0.034996 0.000000 0.000000 0.000000 1.000000
0.049772 0.034973 0.000000 0.000000 0.000000 1.000000
-0.057314 0.034321 0.000000 0.000000 0.000000 1.000000
0.057446 0.034298 0.000000 0.000000 0.000000 1.000000
-0.048257 0.034269 0.000000 0.000000 0.000000 1.000000
0.048388 0.034246 0.000000 0.000000 0.000000 1.000000
-0.058692 0.033196 0.000000 0.000000 0.000000 1.000000
0.058824 0.033173 0.000000 0.000000 0.000000 1.000000
-0.047026 0.033297 0.000000 0.000000 0.000000 1.000000
0.047158 0.033274 0.000000 0.000000 0.000000 1.000000
-0.045992 0.032098 0.000000 0.000000 0.000000 1.000000
0.046124 0.032075 0.000000 0.000000 0.000000 1.000000
-0.059232 0.032657 0.000000 0.000000 0.000000 1.000000
0.059363 0.032634 0.000000 0.000000 0.000000 1.000000
-0.060723 0.031166 0.000000 0.000000 0.000000 1.000000
0.060854 0.031143 0.000000 0.000000 0.000000 1.000000
-0.045199 0.030691 0.000000 0.000000 0.000000 1.000000
0.045331 0.030668 0.000000 0.000000 0.000000 1.000000
-0.062975 0.028914 0.000000 0.000000 0.000000 1.000000
0.063107 0.028891 0.000000 0.000000 0.000000 1.000000
-0.044692 0.029093 0.000000 0.000000 0.000000 1.000000
0.044824 0.029070 0.000000 0.000000 0.000000 1.000000
-0.044512 0.027324 0.000000 0.000000 0.000000 1.000000
0.044645 0.027300 0.000000 0.000000 0.000000 1.000000
-0.065799 0.026091 0.000000 0.000000 0.000000 1.000000
0.065930 0.026068 0.000000 0.000000 0.000000 1.000000
-0.044512 0.026975 0.000000 0.000000 0.000000 1.000000
0.044645 0.009597 0.000000 0.000000 0.000000 1.000000
-0.044512 0.026011 0.000000 0.000000 0.000000 1.000000
-0.069003 0.022888 0.000000 0.000000 0.000000 1.000000
0.069134 0.022865 0.000000 0.000000 0.000000 1.000000
-0.044512 0.024554 0.000000 0.000000 0.000000 1.000000
-0.044512 0.022728 0.000000 0.000000 0.000000 1.000000
-0.072397 0.019494 0.000000 0.000000 0.000000 1.000000
0.072529 0.019471 0.000000 0.000000 0.000000 1.000000
-0.044512 0.020656 0.000000 0.000000 0.000000 1.000000
-0.044512 0.018460 0.000000 0.000000 0.000000 1.000000
-0.075792 0.016100 0.000000 0.000000 0.000000 1.000000
0.075923 0.016077 0.000000 0.000000 0.000000 1.000000
-0.044512 0.016265 0.000000 0.000000 0.000000 1.000000
-0.044512 0.014193 0.000000 0.000000 0.000000 1.000000
-0.078996 0.012897 0.000000 0.000000 0.000000 1.000000
0.079127 0.012874 0.000000 0.000000 0.000000 1.000000
-0.044512 0.012367 0.000000 0.000000 0.000000 1.000000
-0.081819 0.010074 0.000000 0.000000 0.000000 1.000000
0.081951 0.010051 0.000000 0.000000 0.000000 1.000000
-0.044512 0.010910 0.000000 0.000000 0.000000 1.000000
-0.044512 0.009946 0.000000 0.000000 0.000000 1.000000
-0.084072 0.007822 0.000000 0.000000 0.000000 1.000000
0.084203 0.007799 0.000000 0.000000 0.000000 1.000000
-0.044512 0.009597 0.000000 0.000000 0.000000 1.000000
-0.009625 0.009597 0.000000 0.000000 0.000000 1.000000
0.009757 0.009597 0.000000 0.000000 0.000000 1.000000
-0.085563 0.006331 0.000000 0.000000 0.000000 1.000000
0.085694 0.006308 0.000000 0.000000 0.000000 1.000000
-0.086102 0.005792 0.000000 0.000000 0.000000 1.000000
0.086234 0.005769 0.000000 0.000000 0.000000 1.000000
-0.086845 0.004942 0.000000 0.000000 0.000000 1.000000
0.086977 0.004919 0.000000 0.000000 0.000000 1.000000
-0.087454 0.004021 0.000000 0.000000 0.000000 1.000000
0.087585 0.003998 0.000000 0.000000 0.000000 1.000000
-0.087927 0.003045 0.000000 0.000000 0.000000 1.000000
0.088058 0.003022 0.000000 0.000000 0.000000 1.000000
-0.088265 0.002027 0.000000 0.000000 0.000000 1.000000
0.088396 0.002003 0.000000 0.000000 0.000000 1.000000
-0.088467 0.000980 0.000000 0.000000 0.000000 1.000000
0.088599 0.000957 0.000000 0.000000 0.000000 1.000000
-0.088535 -0.000080 0.000000 0.000000 0.000000 1.000000
0.088667 -0.000103 0.000000 0.000000 0.000000 1.000000
-0.088467 -0.001140 0.000000 0.000000 0.000000 1.000000
0.088599 -0.001164 0.000000 0.000000 0.000000 1.000000
-0.088265 -0.002187 0.000000 0.000000 0.000000 1.000000
0.088396 -0.002210 0.000000 0.000000 0.000000 1.000000
-0.087927 -0.003205 0.000000 0.000000 0.000000 1.000000
0.088058 -0.003228 0.000000 0.000000 0.000000 1.000000
-0.087454 -0.004181 0.000000 0.000000 0.000000 1.000000
0.087585 -0.004205 0.000000 0.000000 0.000000 1.000000
-0.086845 -0.005102 0.000000 0.000000 0.000000 1.000000
0.086977 -0.005125 0.000000 0.000000 0.000000 1.000000
-0.086102 -0.005952 0.000000 0.000000 0.000000 1.000000
0.086234 -0.005975 0.000000 0.000000 0.000000 1.000000
-0.085563 -0.006491 0.000000 0.000000 0.000000 1.000000
0.085694 -0.006515 0.000000 0.000000 0.000000 1.000000
-0.084072 -0.007982 0.000000 0.000000 0.000000 1.000000
0.084203 -0.008005 0.000000 0.000000 0.000000 1.000000
-0.081819 -0.010234 0.000000 0.000000 0.000000 1.000000
-0.044512 -0.009780 0.000000 0.000000 0.000000 1.000000
-0.009625 -0.009780 0.000000 0.000000 0.000000 1.000000
0.009757 -0.009780 0.000000 0.000000 0.000000 1.000000
0.044645 -0.009780 0.000000 0.000000 0.000000 1.000000
0.081951 -0.010257 0.000000 0.000000 0.000000 1.000000
-0.044512 -0.027483 0.000000 0.000000 0.000000 1.000000
0.044645 -0.010129 0.000000 0.000000 0.000000 1.000000
0.044645 -0.011093 0.000000 0.000000 0.000000 1.000000
-0.078996 -0.013057 0.000000 0.000000 0.000000 1.000000
0.079127 -0.013080 0.000000 0.000000 0.000000 1.000000
0.044645 -0.012550 0.000000 0.000000 0.000000 1.000000
0.044645 -0.014376 0.000000 0.000000 0.000000 1.000000
-0.075792 -0.016260 0.000000 0.000000 0.000000 1.000000
0.075923 -0.016283 0.000000 0.000000 0.000000 1.000000
0.044645 -0.016448 0.000000 0.000000 0.000000 1.000000
-0.072397 -0.019654 0.000000 0.000000 0.000000 1.000000
0.072529 -0.019677 0.000000 0.000000 0.000000 1.000000
0.044645 -0.018643 0.000000 0.000000 0.000000 1.000000
0.044645 -0.020839 0.000000 0.000000 0.000000 1.000000
-0.069003 -0.023048 0.000000 0.000000 0.000000 1.000000
0.069134 -0.023071 0.000000 0.000000 0.000000 1.000000
0.044645 -0.022911 0.000000 0.000000 0.000000 1.000000
0.044645 -0.024737 0.000000 0.000000 0.000000 1.000000
-0.065799 -0.026251 0.000000 0.000000 0.000000 1.000000
0.065930 -0.026274 0.000000 0.000000 0.000000 1.000000
0.044645 -0.026194 0.000000 0.000000 0.000000 1.000000
0.044645 -0.027158 0.000000 0.000000 0.000000 1.000000
-0.062975 -0.029074 0.000000 0.000000 0.000000 1.000000
0.063107 -0.029097 0.000000 0.000000 0.000000 1.000000
0.044645 -0.027507 0.000000 0.000000 0.000000 1.000000
-0.044692 -0.029253 0.000000 0.000000 0.000000 1.000000
0.044823 -0.029276 0.000000 0.000000 0.000000 1.000000
-0.060723 -0.031326 0.000000 0.000000 0.000000 1.000000
0.060854 -0.031349 0.000000 0.000000 0.000000 1.000000
-0.045199 -0.030851 0.000000 0.000000 0.000000 1.000000
0.045331 -0.030874 0.000000 0.000000 0.000000 1.000000
-0.045992 -0.032258 0.000000 0.000000 0.000000 1.000000
0.046124 -0.032281 0.000000 0.000000 0.000000 1.000000
-0.059232 -0.032817 0.000000 0.000000 0.000000 1.000000
0.059363 -0.032840 0.000000 0.000000 0.000000 1.000000
-0.047026 -0.033457 0.000000 0.000000 0.000000 1.000000
0.047158 -0.033480 0.000000 0.000000 0.000000 1.000000
-0.058692 -0.033356 0.000000 0.000000 0.000000 1.000000
0.058824 -0.033379 0.000000 0.000000 0.000000 1.000000
-0.057314 -0.034481 0.000000 0.000000 0.000000 1.000000
0.057446 -0.034504 0.000000 0.000000 0.000000 1.000000
-0.048257 -0.034429 0.000000 0.000000 0.000000 1.000000
0.048388 -0.034452 0.000000 0.000000 0.000000 1.000000
-0.049640 -0.035156 0.000000 0.000000 0.000000 1.000000
0.049772 -0.035179 0.000000 0.000000 0.000000 1.000000
-0.055825 -0.035251 0.000000 0.000000 0.000000 1.000000
0.055957 -0.035274 0.000000 0.000000 0.000000 1.000000
-0.051133 -0.035620 0.000000 0.000000 0.000000 1.000000
0.051265 -0.035643 0.000000 0.000000 0.000000 1.000000
-0.054269 -0.035686 0.000000 0.000000 0.000000 1.000000
0.054401 -0.035709 0.000000 0.000000 0.000000 1.000000
-0.052690 -0.035803 0.000000 0.000000 0.000000 1.000000
0.052822 -0.035826 0.000000 0.000000 0.000000 1.000000
-0.022692 -0.057385 0.709939 0.000000 0.000000 1.000000
-0.022692 0.057385 0.709939 0.000000 0.000000 1.000000
-0.080077 -0.000000 0.709939 0.000000 0.000000 1.000000
0.023614 0.057385 0.709939 0.000000 0.000000 1.000000
0.023614 -0.057385 0.709939 0.000000 0.000000 1.000000
0.080999 0.000000 0.709939 0.000000 0.000000 1.000000
3 0 1 2
3 3 4 5
3 6 1 0
3 3 7 4
3 6 8 1
3 9 7 3
3 10 8 6
3 9 11 7
3 10 12 8
3 13 11 9
3 14 12 10
3 13 15 11
3 14 16 12
3 17 15 13
3 14 18 16
3 19 15 17
3 20 18 14
3 19 21 15
3 22 18 20
3 19 23 21
3 22 24 18
3 25 23 19
3 26 24 22
3 25 27 23
3 26 28 24
3 29 27 25
3 26 30 28
3 31 27 29
3 32 30 26
3 31 33 27
3 32 34 30
3 35 33 31
3 32 36 34
3 37 36 32
3 35 38 33
3 37 39 36
3 37 40 39
3 41 40 37
3 35 42 38
3 41 43 40
3 41 44 43
3 45 44 41
3 35 46 42
3 45 47 44
3 45 48 47
3 49 48 45
3 35 50 46
3 49 51 48
3 52 51 49
3 35 53 50
3 52 54 51
3 52 55 54
3 56 55 52
3 35 57 53
3 56 58 55
3 56 59 58
3 56 60 59
3 56 35 60
3 56 57 35
3 61 57 56
3 61 62 57
3 63 62 61
3 63 64 62
3 65 64 63
3 65 66 64
3 67 66 65
3 67 68 66
3 69 68 67
3 69 70 68
3 71 70 69
3 71 72 70
3 73 72 71
3 73 74 72
3 75 74 73
3 75 76 74
3 77 76 75
3 77 78 76
3 79 78 77
3 79 80 78
3 81 80 79
3 81 82 80
3 83 82 81
3 83 84 82
3 85 84 83
3 85 86 84
3 87 86 85
3 87 88 86
3 89 88 87
3 89 90 88
3 91 90 89
3 91 92 90
3 93 92 91
3 93 94 92
3 94 95 92
3 95 96 92
3 96 97 92
3 97 98 92
3 93 99 94
3 100 98 97
3 101 98 100
3 102 99 93
3 101 103 98
3 104 103 101
3 105 103 104
3 106 99 102
3 105 107 103
3 108 107 105
3 109 99 106
3 108 110 107
3 111 110 108
3 112 110 111
3 113 99 109
3 112 114 110
3 115 114 112
3 116 114 115
3 117 99 113
3 116 118 114
3 119 118 116
3 120 118 119
3 121 99 117
3 120 122 118
3 123 122 120
3 121 124 99
3 125 122 123
3 126 124 121
3 125 127 122
3 126 128 124
3 129 127 125
3 126 130 128
3 131 127 129
3 132 130 126
3 131 133 127
3 132 134 130
3 135 133 131
3 136 134 132
3 135 137 133
3 138 134 136
3 135 139 137
3 138 140 134
3 141 139 135
3 138 142 140
3 143 139 141
3 144 142 138
3 143 145 139
3 144 146 142
3 147 145 143
3 148 146 144
3 147 149 145
3 148 150 146
3 151 149 147

View File

@@ -0,0 +1,375 @@
ply
format ascii 1.0
comment Created by Blender 3.6.2 - www.blender.org
element vertex 181
property float x
property float y
property float z
property float nx
property float ny
property float nz
element face 181
property list uchar uint vertex_indices
end_header
-0.023240 0.055797 0.000000 0.000000 0.000000 1.000000
-0.017343 0.056143 0.000000 0.000000 0.000000 1.000000
-0.018053 0.056143 0.000000 0.000000 0.000000 1.000000
-0.015379 0.056143 0.000000 0.000000 0.000000 1.000000
-0.012413 0.056143 0.000000 0.000000 0.000000 1.000000
-0.008694 0.056143 0.000000 0.000000 0.000000 1.000000
-0.004474 0.056143 0.000000 0.000000 0.000000 1.000000
-0.000004 0.056143 0.000000 0.000000 0.000000 1.000000
0.004467 0.056143 0.000000 0.000000 0.000000 1.000000
0.008687 0.056143 0.000000 0.000000 0.000000 1.000000
0.012405 0.056143 0.000000 0.000000 0.000000 1.000000
0.015372 0.056143 0.000000 0.000000 0.000000 1.000000
0.017336 0.056143 0.000000 0.000000 0.000000 1.000000
0.018046 0.056143 0.000000 0.000000 0.000000 1.000000
0.023232 0.055797 0.000000 0.000000 0.000000 1.000000
-0.028210 0.054786 0.000000 0.000000 0.000000 1.000000
0.028202 0.054786 0.000000 0.000000 0.000000 1.000000
-0.032919 0.053157 0.000000 0.000000 0.000000 1.000000
0.032912 0.053157 0.000000 0.000000 0.000000 1.000000
-0.037323 0.050954 0.000000 0.000000 0.000000 1.000000
0.037315 0.050954 0.000000 0.000000 0.000000 1.000000
-0.041376 0.048221 0.000000 0.000000 0.000000 1.000000
0.041368 0.048221 0.000000 0.000000 0.000000 1.000000
-0.045034 0.045004 0.000000 0.000000 0.000000 1.000000
0.045026 0.045004 0.000000 0.000000 0.000000 1.000000
-0.048252 0.041347 0.000000 0.000000 0.000000 1.000000
0.048244 0.041347 0.000000 0.000000 0.000000 1.000000
-0.050985 0.037295 0.000000 0.000000 0.000000 1.000000
0.050977 0.037295 0.000000 0.000000 0.000000 1.000000
-0.053188 0.032892 0.000000 0.000000 0.000000 1.000000
0.053181 0.032892 0.000000 0.000000 0.000000 1.000000
-0.054818 0.028184 0.000000 0.000000 0.000000 1.000000
0.054810 0.028184 0.000000 0.000000 0.000000 1.000000
-0.055828 0.023215 0.000000 0.000000 0.000000 1.000000
0.055821 0.023215 0.000000 0.000000 0.000000 1.000000
-0.056175 0.018030 0.000000 0.000000 0.000000 1.000000
-0.007559 0.019518 0.000000 0.000000 0.000000 1.000000
0.007552 0.019518 0.000000 0.000000 0.000000 1.000000
0.056167 0.018030 0.000000 0.000000 0.000000 1.000000
-0.009190 0.019409 0.000000 0.000000 0.000000 1.000000
0.009182 0.019409 0.000000 0.000000 0.000000 1.000000
-0.010752 0.019091 0.000000 0.000000 0.000000 1.000000
0.010745 0.019091 0.000000 0.000000 0.000000 1.000000
-0.012232 0.018579 0.000000 0.000000 0.000000 1.000000
0.012225 0.018579 0.000000 0.000000 0.000000 1.000000
-0.013617 0.017887 0.000000 0.000000 0.000000 1.000000
0.013609 0.017887 0.000000 0.000000 0.000000 1.000000
-0.056175 0.017319 0.000000 0.000000 0.000000 1.000000
0.056167 0.017319 0.000000 0.000000 0.000000 1.000000
-0.014891 0.017028 0.000000 0.000000 0.000000 1.000000
0.014883 0.017028 0.000000 0.000000 0.000000 1.000000
0.056167 0.015356 0.000000 0.000000 0.000000 1.000000
-0.056175 0.015356 0.000000 0.000000 0.000000 1.000000
-0.016040 0.016017 0.000000 0.000000 0.000000 1.000000
0.016033 0.016017 0.000000 0.000000 0.000000 1.000000
-0.017052 0.014867 0.000000 0.000000 0.000000 1.000000
0.017044 0.014867 0.000000 0.000000 0.000000 1.000000
0.056167 0.012390 0.000000 0.000000 0.000000 1.000000
-0.056175 0.012390 0.000000 0.000000 0.000000 1.000000
-0.017910 0.013594 0.000000 0.000000 0.000000 1.000000
0.017903 0.013594 0.000000 0.000000 0.000000 1.000000
-0.018603 0.012210 0.000000 0.000000 0.000000 1.000000
0.018595 0.012210 0.000000 0.000000 0.000000 1.000000
0.056167 0.008673 0.000000 0.000000 0.000000 1.000000
-0.056175 0.008673 0.000000 0.000000 0.000000 1.000000
-0.019115 0.010730 0.000000 0.000000 0.000000 1.000000
0.019108 0.010730 0.000000 0.000000 0.000000 1.000000
-0.019433 0.009168 0.000000 0.000000 0.000000 1.000000
0.019425 0.009168 0.000000 0.000000 0.000000 1.000000
-0.019542 0.007538 0.000000 0.000000 0.000000 1.000000
0.019534 0.007538 0.000000 0.000000 0.000000 1.000000
0.056167 0.004453 0.000000 0.000000 0.000000 1.000000
-0.056175 0.004453 0.000000 0.000000 0.000000 1.000000
-0.019542 0.007241 0.000000 0.000000 0.000000 1.000000
0.019534 0.007241 0.000000 0.000000 0.000000 1.000000
-0.019542 0.006419 0.000000 0.000000 0.000000 1.000000
0.019534 0.006419 0.000000 0.000000 0.000000 1.000000
-0.019542 0.005177 0.000000 0.000000 0.000000 1.000000
0.019534 0.005177 0.000000 0.000000 0.000000 1.000000
-0.019542 0.003621 0.000000 0.000000 0.000000 1.000000
0.019534 0.003621 0.000000 0.000000 0.000000 1.000000
0.056167 -0.000016 0.000000 0.000000 0.000000 1.000000
-0.056175 -0.000016 0.000000 0.000000 0.000000 1.000000
-0.019542 0.001855 0.000000 0.000000 0.000000 1.000000
0.019534 0.001855 0.000000 0.000000 0.000000 1.000000
-0.019542 -0.000016 0.000000 0.000000 0.000000 1.000000
0.019534 -0.000016 0.000000 0.000000 0.000000 1.000000
0.056167 -0.004486 0.000000 0.000000 0.000000 1.000000
-0.019542 -0.001887 0.000000 0.000000 0.000000 1.000000
0.019534 -0.001887 0.000000 0.000000 0.000000 1.000000
-0.056175 -0.004486 0.000000 0.000000 0.000000 1.000000
-0.019542 -0.003653 0.000000 0.000000 0.000000 1.000000
0.019534 -0.003653 0.000000 0.000000 0.000000 1.000000
-0.019542 -0.005210 0.000000 0.000000 0.000000 1.000000
0.019534 -0.005210 0.000000 0.000000 0.000000 1.000000
0.056167 -0.008705 0.000000 0.000000 0.000000 1.000000
-0.056175 -0.008705 0.000000 0.000000 0.000000 1.000000
-0.019542 -0.006451 0.000000 0.000000 0.000000 1.000000
0.019534 -0.006451 0.000000 0.000000 0.000000 1.000000
-0.019542 -0.007273 0.000000 0.000000 0.000000 1.000000
0.019534 -0.007273 0.000000 0.000000 0.000000 1.000000
-0.019542 -0.007570 0.000000 0.000000 0.000000 1.000000
0.019534 -0.007570 0.000000 0.000000 0.000000 1.000000
-0.019433 -0.009200 0.000000 0.000000 0.000000 1.000000
0.019425 -0.009200 0.000000 0.000000 0.000000 1.000000
0.056167 -0.012423 0.000000 0.000000 0.000000 1.000000
-0.056175 -0.012423 0.000000 0.000000 0.000000 1.000000
-0.019115 -0.010762 0.000000 0.000000 0.000000 1.000000
0.019108 -0.010762 0.000000 0.000000 0.000000 1.000000
-0.018603 -0.012242 0.000000 0.000000 0.000000 1.000000
0.018595 -0.012242 0.000000 0.000000 0.000000 1.000000
-0.017910 -0.013626 0.000000 0.000000 0.000000 1.000000
0.017903 -0.013626 0.000000 0.000000 0.000000 1.000000
0.056167 -0.015389 0.000000 0.000000 0.000000 1.000000
-0.056175 -0.015389 0.000000 0.000000 0.000000 1.000000
-0.017051 -0.014900 0.000000 0.000000 0.000000 1.000000
0.017044 -0.014900 0.000000 0.000000 0.000000 1.000000
-0.016040 -0.016049 0.000000 0.000000 0.000000 1.000000
0.016033 -0.016049 0.000000 0.000000 0.000000 1.000000
0.056167 -0.017352 0.000000 0.000000 0.000000 1.000000
-0.056175 -0.017352 0.000000 0.000000 0.000000 1.000000
-0.014891 -0.017060 0.000000 0.000000 0.000000 1.000000
0.014883 -0.017060 0.000000 0.000000 0.000000 1.000000
-0.013617 -0.017919 0.000000 0.000000 0.000000 1.000000
0.013609 -0.017919 0.000000 0.000000 0.000000 1.000000
0.056167 -0.018062 0.000000 0.000000 0.000000 1.000000
-0.056175 -0.018062 0.000000 0.000000 0.000000 1.000000
-0.012232 -0.018611 0.000000 0.000000 0.000000 1.000000
0.012225 -0.018611 0.000000 0.000000 0.000000 1.000000
-0.055828 -0.023247 0.000000 0.000000 0.000000 1.000000
0.055821 -0.023247 0.000000 0.000000 0.000000 1.000000
-0.010752 -0.019123 0.000000 0.000000 0.000000 1.000000
0.010745 -0.019123 0.000000 0.000000 0.000000 1.000000
-0.009190 -0.019441 0.000000 0.000000 0.000000 1.000000
0.009182 -0.019441 0.000000 0.000000 0.000000 1.000000
-0.007559 -0.019550 0.000000 0.000000 0.000000 1.000000
0.007552 -0.019550 0.000000 0.000000 0.000000 1.000000
-0.007262 -0.019550 0.000000 0.000000 0.000000 1.000000
-0.006440 -0.019550 0.000000 0.000000 0.000000 1.000000
-0.005198 -0.019550 0.000000 0.000000 0.000000 1.000000
-0.003642 -0.019550 0.000000 0.000000 0.000000 1.000000
-0.001875 -0.019550 0.000000 0.000000 0.000000 1.000000
-0.000004 -0.019550 0.000000 0.000000 0.000000 1.000000
0.001868 -0.019550 0.000000 0.000000 0.000000 1.000000
0.003634 -0.019550 0.000000 0.000000 0.000000 1.000000
0.005191 -0.019550 0.000000 0.000000 0.000000 1.000000
0.006432 -0.019550 0.000000 0.000000 0.000000 1.000000
0.007255 -0.019550 0.000000 0.000000 0.000000 1.000000
-0.054818 -0.028216 0.000000 0.000000 0.000000 1.000000
0.054810 -0.028216 0.000000 0.000000 0.000000 1.000000
-0.053188 -0.032925 0.000000 0.000000 0.000000 1.000000
0.053181 -0.032925 0.000000 0.000000 0.000000 1.000000
-0.050985 -0.037327 0.000000 0.000000 0.000000 1.000000
0.050977 -0.037327 0.000000 0.000000 0.000000 1.000000
-0.048252 -0.041380 0.000000 0.000000 0.000000 1.000000
0.048244 -0.041380 0.000000 0.000000 0.000000 1.000000
-0.045034 -0.045037 0.000000 0.000000 0.000000 1.000000
0.045026 -0.045037 0.000000 0.000000 0.000000 1.000000
-0.041376 -0.048254 0.000000 0.000000 0.000000 1.000000
0.041368 -0.048254 0.000000 0.000000 0.000000 1.000000
-0.037323 -0.050986 0.000000 0.000000 0.000000 1.000000
0.037315 -0.050986 0.000000 0.000000 0.000000 1.000000
-0.032919 -0.053190 0.000000 0.000000 0.000000 1.000000
0.032912 -0.053190 0.000000 0.000000 0.000000 1.000000
-0.028210 -0.054819 0.000000 0.000000 0.000000 1.000000
0.028202 -0.054819 0.000000 0.000000 0.000000 1.000000
-0.023240 -0.055829 0.000000 0.000000 0.000000 1.000000
0.023232 -0.055829 0.000000 0.000000 0.000000 1.000000
-0.018053 -0.056176 0.000000 0.000000 0.000000 1.000000
0.018046 -0.056176 0.000000 0.000000 0.000000 1.000000
-0.017343 -0.056176 0.000000 -0.294992 -0.955500 0.000000
-0.015379 -0.056176 0.000000 -0.264056 -0.964507 0.000000
-0.012413 -0.056176 0.000000 -0.215761 -0.976446 0.000000
-0.008694 -0.056176 0.000000 -0.152950 -0.988234 0.000000
-0.004474 -0.056176 0.000000 -0.079399 -0.996843 0.000000
-0.000004 -0.056176 0.000000 -0.000068 -1.000000 0.000000
0.004467 -0.056176 0.000000 0.079265 -0.996854 0.000000
0.008687 -0.056176 0.000000 0.152819 -0.988254 0.000000
0.012405 -0.056176 0.000000 0.215635 -0.976474 0.000000
0.015372 -0.056176 0.000000 0.263935 -0.964540 0.000000
0.017336 -0.056176 0.000000 0.294874 -0.955536 0.000000
3 0 1 2
3 0 3 1
3 0 4 3
3 0 5 4
3 0 6 5
3 0 7 6
3 0 8 7
3 0 9 8
3 0 10 9
3 0 11 10
3 0 12 11
3 0 13 12
3 0 14 13
3 15 14 0
3 15 16 14
3 17 16 15
3 17 18 16
3 19 18 17
3 19 20 18
3 21 20 19
3 21 22 20
3 23 22 21
3 23 24 22
3 25 24 23
3 25 26 24
3 27 26 25
3 27 28 26
3 29 28 27
3 29 30 28
3 31 30 29
3 31 32 30
3 33 32 31
3 33 34 32
3 35 34 33
3 35 36 34
3 36 37 34
3 37 38 34
3 35 39 36
3 40 38 37
3 35 41 39
3 42 38 40
3 35 43 41
3 44 38 42
3 35 45 43
3 46 38 44
3 47 45 35
3 46 48 38
3 47 49 45
3 50 48 46
3 50 51 48
3 52 49 47
3 52 53 49
3 54 51 50
3 52 55 53
3 56 51 54
3 56 57 51
3 58 55 52
3 58 59 55
3 60 57 56
3 58 61 59
3 62 57 60
3 62 63 57
3 64 61 58
3 64 65 61
3 66 63 62
3 64 67 65
3 68 63 66
3 64 69 67
3 70 63 68
3 70 71 63
3 72 69 64
3 72 73 69
3 74 71 70
3 72 75 73
3 76 71 74
3 72 77 75
3 78 71 76
3 72 79 77
3 80 71 78
3 80 81 71
3 82 79 72
3 82 83 79
3 84 81 80
3 82 85 83
3 86 81 84
3 86 87 81
3 82 88 85
3 89 87 86
3 90 88 82
3 90 91 88
3 92 87 89
3 90 93 91
3 94 87 92
3 94 95 87
3 96 93 90
3 96 97 93
3 98 95 94
3 96 99 97
3 100 95 98
3 96 101 99
3 102 95 100
3 96 103 101
3 104 95 102
3 104 105 95
3 106 103 96
3 106 107 103
3 108 105 104
3 106 109 107
3 110 105 108
3 106 111 109
3 112 105 110
3 112 113 105
3 114 111 106
3 114 115 111
3 116 113 112
3 114 117 115
3 118 113 116
3 118 119 113
3 120 117 114
3 120 121 117
3 122 119 118
3 120 123 121
3 124 119 122
3 124 125 119
3 126 123 120
3 126 127 123
3 128 125 124
3 129 127 126
3 128 130 125
3 129 131 127
3 132 130 128
3 129 133 131
3 134 130 132
3 129 135 133
3 136 130 134
3 129 137 135
3 129 138 137
3 129 139 138
3 129 140 139
3 129 141 140
3 129 142 141
3 129 143 142
3 129 144 143
3 129 145 144
3 129 146 145
3 129 147 146
3 129 136 147
3 129 130 136
3 148 130 129
3 148 149 130
3 150 149 148
3 150 151 149
3 152 151 150
3 152 153 151
3 154 153 152
3 154 155 153
3 156 155 154
3 156 157 155
3 158 157 156
3 158 159 157
3 160 159 158
3 160 161 159
3 162 161 160
3 162 163 161
3 164 163 162
3 164 165 163
3 166 165 164
3 166 167 165
3 168 167 166
3 168 169 167
3 170 169 168
3 171 169 170
3 172 169 171
3 173 169 172
3 174 169 173
3 175 169 174
3 176 169 175
3 177 169 176
3 178 169 177
3 179 169 178
3 180 169 179

View File

@@ -5,19 +5,20 @@ element vertex 8
property float x
property float y
property float z
property float s
property float t
property float nx
property float ny
property float nz
element face 8
property list uchar uint vertex_indices
end_header
0.000033 -0.077635 0.000000 1.000000 0.000000
-0.061729 -0.000433 0.000000 0.000000 1.000000
-0.077169 -0.000433 0.000000 0.000000 0.000000
0.000033 0.061329 0.000000 0.000000 1.000000
0.000033 0.076770 0.000000 0.000000 0.000000
0.077235 -0.000433 0.000000 0.000000 0.000000
0.061795 -0.000433 0.000000 0.000000 1.000000
0.000033 -0.062195 0.000000 1.000000 1.000000
0.000033 -0.077635 0.000000 0.000000 0.000000 1.000000
-0.061729 -0.000433 0.000000 0.000000 0.000000 1.000000
-0.077169 -0.000433 0.000000 0.000000 0.000000 1.000000
0.000033 0.061329 0.000000 0.000000 0.000000 1.000000
0.000033 0.076770 0.000000 0.000000 0.000000 1.000000
0.077235 -0.000433 0.000000 0.000000 0.000000 1.000000
0.061795 -0.000433 0.000000 0.000000 0.000000 1.000000
0.000033 -0.062195 0.000000 0.000000 0.000000 1.000000
3 0 1 2
3 2 3 4
3 3 5 4

View File

@@ -34,12 +34,14 @@ void main()
coef[3] * vec2(iNodes[3].x + 1.0, iNodes[3].y + 1.0);
vec3 pos = vec3( P / (coef[0] + coef[1] + coef[2] + coef[3]), position.z );
// Rounding corners with attractor parameter w
vec3 rounded = ( smoothstep(0.0, 1.0, length(position.xy)) ) * normalize(vec3(position.xy, 0.01));
// Rounding corners with attractor parameter iNodes[0].w
float d = length(pos.xy);
d = d / pow( 1.0 + pow(d, 10.0), 0.1 );
vec3 rounded = d * normalize(vec3(pos.xy, 0.0));
pos = mix( pos, rounded, corners.x * iNodes[0].w);
pos = mix( pos, rounded, corners.y * iNodes[1].w);
pos = mix( pos, rounded, corners.z * iNodes[2].w);
pos = mix( pos, rounded, corners.w * iNodes[3].w);
pos = mix( pos, rounded, corners.y * iNodes[0].w);
pos = mix( pos, rounded, corners.z * iNodes[0].w);
pos = mix( pos, rounded, corners.w * iNodes[0].w);
// output
gl_Position = projection * ( modelview * vec4(pos, 1.0) );

View File

@@ -220,6 +220,7 @@ Handles::Handles(Type type) : Node(), type_(type)
static Mesh *handle_shadow = new Mesh("mesh/border_handles_shadow.ply", "images/soft_shadow.dds");
static Mesh *handle_node = new Mesh("mesh/border_handles_sharp.ply");
static Mesh *handle_crop_h = new Mesh("mesh/border_handles_arrows.ply");
static Mesh *handle_rounding = new Mesh("mesh/border_handles_roundcorner.ply");
color = glm::vec4( 1.f, 1.f, 1.f, 1.f);
corner_ = glm::vec2(0.f, 0.f);
@@ -252,11 +253,11 @@ Handles::Handles(Type type) : Node(), type_(type)
else if ( type_ >= Handles::NODE_LOWER_LEFT && type_ <= Handles::NODE_UPPER_RIGHT ) {
handle_ = handle_node;
}
else if ( type_ == Handles::CROP_H ) {
else if ( type_ == Handles::CROP_H || type_ == Handles::CROP_V ) {
handle_ = handle_crop_h;
}
else if ( type_ == Handles::CROP_V ) {
handle_ = handle_crop_h;
else if ( type_ == Handles::ROUNDING ) {
handle_ = handle_rounding;
}
else {
handle_ = handle_corner;
@@ -480,6 +481,18 @@ void Handles::draw(glm::mat4 modelview, glm::mat4 projection)
ctm = glm::rotate(ctm, M_PI_2f, glm::vec3(0.f, 0.f, 1.f));
handle_->draw( ctm, projection );
}
else if ( type_ == Handles::ROUNDING ){
// one icon in top right corner
// 1. Fixed displacement by (0.0,0.12) along the rotation..
ctm = GlmToolkit::transform(glm::vec4(0.f), rot, mirror);
glm::vec4 pos = ctm * glm::vec4( 0.0f, 0.13f, 0.f, 1.f);
// 2. ..from the top right corner (1,1)
vec = ( modelview * glm::vec4(translation_.x +1.f, 1.f, 0.f, 1.f) ) + pos;
ctm = GlmToolkit::transform(vec, rot, glm::vec3(1.f));
// 3. draw
shadow_->draw( ctm, projection );
handle_->draw( ctm, projection );
}
}
}

View File

@@ -48,6 +48,7 @@ public:
NODE_UPPER_RIGHT,
CROP_H,
CROP_V,
ROUNDING,
EDIT_CROP,
EDIT_SHAPE,
MENU,

View File

@@ -843,6 +843,9 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
// picking on a Node
if (pick.first == s->handles_[mode_][Handles::NODE_LOWER_LEFT]) {
// hide other grips
s->handles_[mode_][Handles::CROP_H]->visible_ = false;
s->handles_[mode_][Handles::CROP_V]->visible_ = false;
s->handles_[mode_][Handles::ROUNDING]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
// get stored status
@@ -858,13 +861,18 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
node_pos = grid->snap(node_pos);
// Compute handle coordinates back in SOURCE reference frame
node_pos = scene_to_source_transform * glm::vec4(node_pos, 1.f);
// Diagonal SCALING with SHIFT
if (UserInterface::manager().shiftModifier())
node_pos.y = node_pos.x;
// apply to source Node and to handles
sourceNode->data_[0].x = CLAMP( node_pos.x, 0.f, 0.99f );
sourceNode->data_[0].y = CLAMP( node_pos.y, 0.f, 0.99f );
}
else if (pick.first == s->handles_[mode_][Handles::NODE_UPPER_LEFT]) {
// hide other grips
s->handles_[mode_][Handles::CROP_H]->visible_ = false;
s->handles_[mode_][Handles::CROP_V]->visible_ = false;
s->handles_[mode_][Handles::ROUNDING]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
// get stored status
@@ -880,13 +888,18 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
node_pos = grid->snap(node_pos);
// Compute handle coordinates back in SOURCE reference frame
node_pos = scene_to_source_transform * glm::vec4(node_pos, 1.f);
// Diagonal SCALING with SHIFT
if (UserInterface::manager().shiftModifier())
node_pos.y = node_pos.x;
// apply to source Node and to handles
sourceNode->data_[1].x = CLAMP( node_pos.x, 0.f, 0.99f );
sourceNode->data_[1].y = CLAMP( node_pos.y, -0.99f, 0.f );
}
else if ( pick.first == s->handles_[mode_][Handles::NODE_LOWER_RIGHT] ) {
// hide other grips
s->handles_[mode_][Handles::CROP_H]->visible_ = false;
s->handles_[mode_][Handles::CROP_V]->visible_ = false;
s->handles_[mode_][Handles::ROUNDING]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
// get stored status
@@ -902,13 +915,18 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
node_pos = grid->snap(node_pos);
// Compute handle coordinates back in SOURCE reference frame
node_pos = scene_to_source_transform * glm::vec4(node_pos, 1.f);
// Diagonal SCALING with SHIFT
if (UserInterface::manager().shiftModifier())
node_pos.y = node_pos.x;
// apply to source Node and to handles
sourceNode->data_[2].x = CLAMP( node_pos.x, -0.99f, 0.f );
sourceNode->data_[2].y = CLAMP( node_pos.y, 0.f, 0.99f );
}
else if (pick.first == s->handles_[mode_][Handles::NODE_UPPER_RIGHT]) {
// hide other grips
s->handles_[mode_][Handles::CROP_H]->visible_ = false;
s->handles_[mode_][Handles::CROP_V]->visible_ = false;
s->handles_[mode_][Handles::ROUNDING]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
@@ -925,35 +943,44 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
node_pos = grid->snap(node_pos);
// Compute handle coordinates back in SOURCE reference frame
node_pos = scene_to_source_transform * glm::vec4(node_pos, 1.f);
// Diagonal SCALING with SHIFT
if (UserInterface::manager().shiftModifier())
node_pos.y = node_pos.x;
// apply to source Node and to handles
sourceNode->data_[3].x = CLAMP( node_pos.x, -0.99f, 0.f );
sourceNode->data_[3].y = CLAMP( node_pos.y, -0.99f, 0.f );
}
// horizontal CROP
else if (pick.first == s->handles_[mode_][Handles::CROP_H]) {
// hide all other grips
s->handles_[mode_][Handles::NODE_LOWER_RIGHT]->visible_ = false;
s->handles_[mode_][Handles::NODE_LOWER_LEFT]->visible_ = false;
s->handles_[mode_][Handles::NODE_UPPER_RIGHT]->visible_ = false;
s->handles_[mode_][Handles::NODE_UPPER_LEFT]->visible_ = false;
s->handles_[mode_][Handles::ROUNDING]->visible_ = false;
s->handles_[mode_][Handles::CROP_V]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
// prepare overlay
glm::vec3 _prev_crop_scale = 0.5f
* glm::vec3(s->stored_status_->crop_[0]
// prepare overlay frame showing full image size
glm::vec3 _c_s = glm::vec3(s->stored_status_->crop_[0]
- s->stored_status_->crop_[1],
s->stored_status_->crop_[3]
- s->stored_status_->crop_[2],
2.f);
overlay_crop_->scale_ = s->stored_status_->scale_ / _prev_crop_scale;
2.f)
* 0.5f;
overlay_crop_->scale_ = s->stored_status_->scale_ / _c_s;
overlay_crop_->scale_.x *= s->frame()->aspectRatio();
overlay_crop_->translation_.x = s->stored_status_->translation_.x;
overlay_crop_->translation_.x
+= (s->stored_status_->crop_[1] + _prev_crop_scale.x) * overlay_crop_->scale_.x;
overlay_crop_->translation_.y = s->stored_status_->translation_.y;
overlay_crop_->translation_.y
+= -s->stored_status_->crop_[3] + _prev_crop_scale.y;
overlay_crop_->rotation_.z = s->stored_status_->rotation_.z;
overlay_crop_->translation_ = s->stored_status_->translation_;
glm::vec3 _t((s->stored_status_->crop_[1] + _c_s.x) * overlay_crop_->scale_.x,
-s->stored_status_->crop_[3] + _c_s.y, 0.f);
_t = glm::rotate(glm::identity<glm::mat4>(),
overlay_crop_->rotation_.z,
glm::vec3(0.f, 0.f, 1.f))
* glm::vec4(_t, 1.f);
overlay_crop_->translation_ += _t;
overlay_crop_->translation_.z = 0.f;
overlay_crop_->update(0);
overlay_crop_->visible_ = true;
@@ -1016,30 +1043,37 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
info << "Crop H " << std::fixed << std::setprecision(3) << sourceNode->crop_[0];
info << " x " << sourceNode->crop_[1];
}
// Vertical CROP
else if (pick.first == s->handles_[mode_][Handles::CROP_V]) {
// hide all other grips
s->handles_[mode_][Handles::NODE_LOWER_RIGHT]->visible_ = false;
s->handles_[mode_][Handles::NODE_LOWER_LEFT]->visible_ = false;
s->handles_[mode_][Handles::NODE_UPPER_RIGHT]->visible_ = false;
s->handles_[mode_][Handles::NODE_UPPER_LEFT]->visible_ = false;
s->handles_[mode_][Handles::ROUNDING]->visible_ = false;
s->handles_[mode_][Handles::CROP_H]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
// prepare overlay
glm::vec3 _prev_crop_scale = 0.5f
* glm::vec3(s->stored_status_->crop_[0]
// prepare overlay frame showing full image size
glm::vec3 _c_s = glm::vec3(s->stored_status_->crop_[0]
- s->stored_status_->crop_[1],
s->stored_status_->crop_[3]
- s->stored_status_->crop_[2],
2.f);
overlay_crop_->scale_ = s->stored_status_->scale_ / _prev_crop_scale;
2.f)
* 0.5f;
overlay_crop_->scale_ = s->stored_status_->scale_ / _c_s;
overlay_crop_->scale_.x *= s->frame()->aspectRatio();
overlay_crop_->translation_.x = s->stored_status_->translation_.x;
overlay_crop_->translation_.x
+= (s->stored_status_->crop_[1] + _prev_crop_scale.x) * overlay_crop_->scale_.x;
overlay_crop_->translation_.y = s->stored_status_->translation_.y;
overlay_crop_->translation_.y
+= -s->stored_status_->crop_[3] + _prev_crop_scale.y;
overlay_crop_->rotation_.z = s->stored_status_->rotation_.z;
overlay_crop_->translation_ = s->stored_status_->translation_;
glm::vec3 _t((s->stored_status_->crop_[1] + _c_s.x) * overlay_crop_->scale_.x,
-s->stored_status_->crop_[3] + _c_s.y, 0.f);
_t = glm::rotate(glm::identity<glm::mat4>(),
overlay_crop_->rotation_.z,
glm::vec3(0.f, 0.f, 1.f))
* glm::vec4(_t, 1.f);
overlay_crop_->translation_ += _t;
overlay_crop_->translation_.z = 0.f;
overlay_crop_->update(0);
overlay_crop_->visible_ = true;
@@ -1102,6 +1136,27 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
info << "Crop V " << std::fixed << std::setprecision(3) << sourceNode->crop_[2];
info << " x " << sourceNode->crop_[3];
}
// pick the corner rounding handle
else if (pick.first == s->handles_[mode_][Handles::ROUNDING]) {
// hide other grips
s->handles_[mode_][Handles::CROP_H]->visible_ = false;
s->handles_[mode_][Handles::CROP_V]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
// get stored status
// glm::vec3 node_pos = glm::vec3( -s->stored_status_->data_[0].z, 0.f, 0.f);
glm::vec3 node_pos = glm::vec3( -s->stored_status_->data_[0].w, 0.f, 0.f);
// Compute target coordinates of manipulated handle into SCENE reference frame
node_pos = source_to_scene_transform * glm::vec4(node_pos, 1.f);
// apply translation of target in SCENE
node_pos = glm::translate(glm::identity<glm::mat4>(), scene_to - scene_from) * glm::vec4(node_pos, 1.f);
// Compute handle coordinates back in SOURCE reference frame
node_pos = scene_to_source_transform * glm::vec4(node_pos, 1.f);
// apply to source Node and to handles
// sourceNode->data_[0].z = - CLAMP( node_pos.x, -1.f, 0.f );
sourceNode->data_[0].w = - CLAMP( node_pos.x, -1.f, 0.f );
}
// picking on the resizing handles in the corners RESIZE CORNER
else if ( pick.first == s->handles_[mode_][Handles::RESIZE] ) {
// hide other grips
@@ -1164,7 +1219,7 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
s->handles_[mode_][Handles::SCALE]->visible_ = false;
s->handles_[mode_][Handles::RESIZE_V]->visible_ = false;
s->handles_[mode_][Handles::ROTATE]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
s->handles_[mode_][Handles::EDIT_SHAPE]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
// inform on which corner should be overlayed (opposite)
s->handles_[mode_][Handles::RESIZE_H]->overlayActiveCorner(-corner);
@@ -1218,7 +1273,7 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
s->handles_[mode_][Handles::SCALE]->visible_ = false;
s->handles_[mode_][Handles::RESIZE_H]->visible_ = false;
s->handles_[mode_][Handles::ROTATE]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
s->handles_[mode_][Handles::EDIT_SHAPE]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
// inform on which corner should be overlayed (opposite)
s->handles_[mode_][Handles::RESIZE_V]->overlayActiveCorner(-corner);
@@ -1272,7 +1327,7 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
s->handles_[mode_][Handles::RESIZE_H]->visible_ = false;
s->handles_[mode_][Handles::RESIZE_V]->visible_ = false;
s->handles_[mode_][Handles::ROTATE]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
s->handles_[mode_][Handles::EDIT_SHAPE]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
// prepare overlay
overlay_scaling_cross_->visible_ = false;
@@ -1376,7 +1431,7 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
s->handles_[mode_][Handles::RESIZE_H]->visible_ = false;
s->handles_[mode_][Handles::RESIZE_V]->visible_ = false;
s->handles_[mode_][Handles::SCALE]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
s->handles_[mode_][Handles::EDIT_SHAPE]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
// ROTATION on CENTER
overlay_rotation_->visible_ = true;
@@ -1529,18 +1584,11 @@ void GeometryView::terminate(bool force)
glm::vec2 c(0.f, 0.f);
for (auto sit = Mixer::manager().session()->begin();
sit != Mixer::manager().session()->end(); ++sit){
(*sit)->handles_[mode_][Handles::RESIZE]->overlayActiveCorner(c);
(*sit)->handles_[mode_][Handles::RESIZE_H]->overlayActiveCorner(c);
(*sit)->handles_[mode_][Handles::RESIZE_V]->overlayActiveCorner(c);
(*sit)->handles_[mode_][Handles::RESIZE]->visible_ = true;
(*sit)->handles_[mode_][Handles::RESIZE_H]->visible_ = true;
(*sit)->handles_[mode_][Handles::RESIZE_V]->visible_ = true;
(*sit)->handles_[mode_][Handles::SCALE]->visible_ = true;
(*sit)->handles_[mode_][Handles::ROTATE]->visible_ = true;
(*sit)->handles_[mode_][Handles::EDIT_CROP]->visible_ = true;
(*sit)->handles_[mode_][Handles::EDIT_SHAPE]->visible_ = true;
(*sit)->handles_[mode_][Handles::MENU]->visible_ = true;
for (auto h = 0; h < 15; ++h)
(*sit)->handles_[mode_][h]->visible_ = true;
}
overlay_selection_active_ = false;

View File

@@ -207,6 +207,11 @@ void PickingVisitor::visit(Handles &n)
else if ( n.type() == Handles::NODE_UPPER_RIGHT ){
picked = glm::length( glm::vec2(1.f, 1.f) - glm::vec2(P) ) < scale;
}
else if ( n.type() == Handles::ROUNDING ){
// the icon for rotation is on the right top corner at (0., 0.13) in scene coordinates
glm::vec4 pos = glm::inverse(ctm) * ( mirror * glm::vec4( 0.f, 0.13f, 0.f, 0.f ) );
picked = glm::length( glm::vec2( 1.f, 1.f) + glm::vec2(pos) - glm::vec2(P) ) < 1.5f * scale;
}
if ( picked )
// add this to the nodes picked

View File

@@ -257,6 +257,10 @@ Source::Source(uint64_t id) : SourceCore(), id_(id), ready_(false), symbol_(null
handles_[View::GEOMETRY][Handles::CROP_V]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::CROP_V]->translation_.z = 0.1;
node_manipulator->attach(handles_[View::GEOMETRY][Handles::CROP_V]);
handles_[View::GEOMETRY][Handles::ROUNDING] = new Handles(Handles::ROUNDING);
handles_[View::GEOMETRY][Handles::ROUNDING]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::ROUNDING]->translation_.z = 0.1;
node_manipulator->attach(handles_[View::GEOMETRY][Handles::ROUNDING]);
handles_[View::GEOMETRY][Handles::EDIT_CROP] = new Handles(Handles::EDIT_CROP);
handles_[View::GEOMETRY][Handles::EDIT_CROP]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::EDIT_CROP]->translation_.z = 0.1;
@@ -833,8 +837,10 @@ void Source::update(float dt)
// TODO : should it be applied to MIXING view?
// Mixing and layer icons scaled based on GEOMETRY crop
mixingsurface_->scale_.y = groups_[View::GEOMETRY]->crop_[1];
mixingsurface_->scale_.x = groups_[View::GEOMETRY]->crop_[2] * renderbuffer_->aspectRatio();
mixingsurface_->scale_.y = (groups_[View::GEOMETRY]->crop_[2]
- groups_[View::GEOMETRY]->crop_[3]) * 0.5f;
mixingsurface_->scale_.x = (groups_[View::GEOMETRY]->crop_[1]
- groups_[View::GEOMETRY]->crop_[0]) * 0.5f * renderbuffer_->aspectRatio();
mixingsurface_->update(dt_);
// update nodes distortion
@@ -849,6 +855,9 @@ void Source::update(float dt)
handles_[View::GEOMETRY][Handles::NODE_UPPER_RIGHT]->translation_.x = groups_[View::GEOMETRY]->data_[3].x;
handles_[View::GEOMETRY][Handles::NODE_UPPER_RIGHT]->translation_.y = groups_[View::GEOMETRY]->data_[3].y;
// handles_[View::GEOMETRY][Handles::ROUNDING]->translation_.x = - groups_[View::GEOMETRY]->data_[0].z;
handles_[View::GEOMETRY][Handles::ROUNDING]->translation_.x = - groups_[View::GEOMETRY]->data_[0].w;
// Layers icons are displayed in Perspective (diagonal)
groups_[View::LAYER]->translation_.x = -groups_[View::LAYER]->translation_.z;
groups_[View::LAYER]->translation_.y = groups_[View::LAYER]->translation_.x / LAYER_PERSPECTIVE;

View File

@@ -332,7 +332,7 @@ protected:
// overlays and frames to be displayed on top of source
std::map<View::Mode, Group*> overlays_;
std::map<View::Mode, Switch*> frames_;
std::map<View::Mode, Handles*[14]> handles_;
std::map<View::Mode, Handles*[15]> handles_;
Handles *lock_, *unlock_;
Switch *locker_, *manipulator_;
Symbol *symbol_;