DRAFT Source geometry distortion shape nodes

MeshSurface allows distortion of surface of sources, image shader vertex change of mesh surface, new handles to distort mesh in geometry view
This commit is contained in:
Bruno Herbelin
2023-12-10 22:12:28 +01:00
parent 95de6d0afc
commit d66751b6ac
31 changed files with 2151 additions and 201 deletions

View File

@@ -543,6 +543,7 @@ set(VMIX_RSC_FILES
./rsc/mesh/border_handles_sharp.ply
./rsc/mesh/border_handles_menu.ply
./rsc/mesh/border_handles_crop.ply
./rsc/mesh/border_handles_shape.ply
./rsc/mesh/border_handles_lock.ply
./rsc/mesh/border_handles_lock_open.ply
./rsc/mesh/border_handles_shadow.ply
@@ -585,6 +586,7 @@ set(VMIX_RSC_FILES
./rsc/mesh/icon_sequence.ply
./rsc/mesh/icon_receive.ply
./rsc/mesh/icon_text.ply
./rsc/mesh/icon_magnet.ply
./rsc/mesh/h_line.ply
./rsc/mesh/h_mark.ply
./rsc/shaders/filters/default.glsl

View File

@@ -0,0 +1,836 @@
ply
format ascii 1.0
comment Created by Blender 3.6.2 - www.blender.org
element vertex 408
property float x
property float y
property float z
property float s
property float t
element face 416
property list uchar uint vertex_indices
end_header
-0.061080 0.071828 0.000000 0.002457 0.000000
-0.059392 0.071909 0.000000 0.705160 0.000000
-0.059904 0.071909 0.000000 0.000000 0.000000
-0.057977 0.071909 0.000000 0.702703 0.000000
-0.055840 0.071909 0.000000 0.700246 0.000000
-0.053161 0.071909 0.000000 0.697789 0.000000
-0.050120 0.071909 0.000000 0.695332 0.000000
-0.046899 0.071909 0.000000 0.692875 0.000000
-0.043678 0.071909 0.000000 0.690418 0.000000
-0.040638 0.071909 0.000000 0.687961 0.000000
-0.037958 0.071909 0.000000 0.685504 0.000000
-0.035821 0.071909 0.000000 0.683047 0.000000
-0.034406 0.071909 0.000000 0.680590 0.000000
-0.033895 0.071909 0.000000 0.678133 0.000000
-0.032718 0.071828 0.000000 0.675676 0.000000
0.034287 0.071828 0.000000 0.592138 0.000000
0.035975 0.071909 0.000000 0.587224 0.000000
0.035463 0.071909 0.000000 0.589681 0.000000
0.037389 0.071909 0.000000 0.584767 0.000000
0.039527 0.071909 0.000000 0.582310 0.000000
0.042206 0.071909 0.000000 0.579853 0.000000
0.045246 0.071909 0.000000 0.577396 0.000000
0.048467 0.071909 0.000000 0.574939 0.000000
0.051688 0.071909 0.000000 0.572482 0.000000
0.054729 0.071909 0.000000 0.570025 0.000000
0.057408 0.071909 0.000000 0.567568 0.000000
0.059545 0.071909 0.000000 0.565111 0.000000
0.060960 0.071909 0.000000 0.562654 0.000000
0.061472 0.071909 0.000000 0.560197 0.000000
0.062648 0.071828 0.000000 0.557740 0.000000
-0.062208 0.071595 0.000000 0.004914 0.000000
0.033158 0.071595 0.000000 0.594595 0.000000
-0.031590 0.071595 0.000000 0.673219 0.000000
0.063776 0.071595 0.000000 0.555283 0.000000
-0.063278 0.071219 0.000000 0.007371 0.000000
0.032089 0.071219 0.000000 0.597052 0.000000
-0.030520 0.071219 0.000000 0.670762 0.000000
0.064846 0.071219 0.000000 0.552826 0.000000
-0.064279 0.070711 0.000000 0.009828 0.000000
0.031087 0.070711 0.000000 0.599509 0.000000
-0.029519 0.070711 0.000000 0.668305 0.000000
0.065847 0.070711 0.000000 0.550369 0.000000
-0.065201 0.070081 0.000000 0.012285 0.000000
0.030165 0.070081 0.000000 0.601966 0.000000
-0.028597 0.070081 0.000000 0.665848 0.000000
0.066769 0.070081 0.000000 0.547912 0.000000
-0.066034 0.069339 0.000000 0.014742 0.000000
0.029333 0.069339 0.000000 0.604423 0.000000
-0.027765 0.069339 0.000000 0.663391 0.000000
0.067602 0.069339 0.000000 0.545455 0.000000
-0.066767 0.068497 0.000000 0.017199 0.000000
0.028600 0.068497 0.000000 0.606880 0.000000
-0.027032 0.068497 0.000000 0.660934 0.000000
0.068335 0.068497 0.000000 0.542998 0.000000
-0.067389 0.067564 0.000000 0.019656 0.000000
0.027977 0.067564 0.000000 0.609337 0.000000
-0.026409 0.067564 0.000000 0.658477 0.000000
0.068958 0.067564 0.000000 0.540541 0.000000
-0.067892 0.066551 0.000000 0.022113 0.000000
0.027475 0.066551 0.000000 0.611794 0.000000
-0.025906 0.066551 0.000000 0.656020 0.000000
0.069460 0.066551 0.000000 0.538084 0.000000
-0.068263 0.065469 0.000000 0.024570 0.000000
0.027103 0.065469 0.000000 0.614251 0.000000
-0.025535 0.065469 0.000000 0.653563 0.000000
0.069832 0.065469 0.000000 0.535627 0.000000
-0.068494 0.064327 0.000000 0.027027 0.000000
0.026872 0.064327 0.000000 0.616708 0.000000
-0.025304 0.064327 0.000000 0.651106 0.000000
0.070062 0.064327 0.000000 0.533170 0.000000
-0.068573 0.063137 0.000000 0.029484 0.000000
0.026793 0.063137 0.000000 0.619165 0.000000
-0.025225 0.063137 0.000000 0.648649 0.000000
0.070141 0.063137 0.000000 0.530713 0.000000
-0.068573 0.062620 0.000000 0.031941 0.000000
-0.024201 0.063137 0.000000 0.646192 0.000000
-0.021372 0.063137 0.000000 0.643735 0.000000
-0.017097 0.063137 0.000000 0.641278 0.000000
-0.011739 0.063137 0.000000 0.638821 0.000000
-0.005658 0.063137 0.000000 0.636364 0.000000
0.000784 0.063137 0.000000 0.633907 0.000000
0.007226 0.063137 0.000000 0.631450 0.000000
0.013307 0.063137 0.000000 0.628993 0.000000
0.018665 0.063137 0.000000 0.626536 0.000000
0.022940 0.063137 0.000000 0.624079 0.000000
0.025770 0.063137 0.000000 0.621622 0.000000
0.070141 0.062620 0.000000 0.528256 0.000000
0.070141 0.061188 0.000000 0.525798 0.000000
-0.068573 0.061188 0.000000 0.034398 0.000000
0.059807 0.060915 0.000000 0.719902 0.000000
0.070141 0.059026 0.000000 0.523342 0.000000
-0.068573 0.059026 0.000000 0.036855 0.000000
-0.057876 0.060915 0.000000 0.707617 0.000000
-0.057876 0.039359 0.000000 0.714988 0.000000
-0.036289 0.060915 0.000000 0.710074 0.000000
-0.036289 0.039359 0.000000 0.712531 0.000000
-0.025225 0.045595 0.000000 0.727273 0.000000
0.038220 0.060915 0.000000 0.717445 0.000000
0.026793 0.045595 0.000000 0.729730 0.000000
0.038220 0.039359 0.000000 0.724816 0.000000
0.059807 0.039359 0.000000 0.722359 0.000000
0.070141 0.056315 0.000000 0.520885 0.000000
-0.068573 0.056315 0.000000 0.039312 0.000000
0.070141 0.053239 0.000000 0.518427 0.000000
-0.068573 0.053239 0.000000 0.041769 0.000000
0.070141 0.049981 0.000000 0.515971 0.000000
-0.068573 0.049981 0.000000 0.044226 0.000000
0.070141 0.046722 0.000000 0.513514 0.000000
-0.068573 0.046722 0.000000 0.046683 0.000000
0.070141 0.043646 0.000000 0.511056 0.000000
-0.068573 0.043646 0.000000 0.049140 0.000000
-0.025225 0.045422 0.000000 0.980344 0.000000
0.026793 0.036824 0.000000 0.732187 0.000000
-0.025225 0.044945 0.000000 0.977887 0.000000
-0.025225 0.044225 0.000000 0.975430 0.000000
-0.025225 0.043321 0.000000 0.972973 0.000000
0.070141 0.040935 0.000000 0.508600 0.000000
-0.068573 0.040935 0.000000 0.051597 0.000000
-0.025225 0.042296 0.000000 0.970516 0.000000
-0.025225 0.041209 0.000000 0.968059 0.000000
-0.025225 0.040123 0.000000 0.965602 0.000000
0.070141 0.038773 0.000000 0.506142 0.000000
-0.068573 0.038773 0.000000 0.054054 0.000000
-0.025225 0.039098 0.000000 0.963145 0.000000
-0.025225 0.038194 0.000000 0.960688 0.000000
0.070141 0.037342 0.000000 0.503685 0.000000
-0.068573 0.037342 0.000000 0.056511 0.000000
-0.025225 0.037474 0.000000 0.958231 0.000000
-0.025225 0.036996 0.000000 0.955774 0.000000
0.070141 0.036824 0.000000 0.501229 0.000000
-0.068573 0.036824 0.000000 0.058968 0.000000
-0.025225 0.036824 0.000000 0.953317 0.000000
-0.068494 0.035634 0.000000 0.061425 0.000000
-0.025304 0.035634 0.000000 0.950860 0.000000
0.026872 0.035634 0.000000 0.734644 0.000000
0.070062 0.035634 0.000000 0.498771 0.000000
-0.025535 0.034492 0.000000 0.948403 0.000000
0.069832 0.034492 0.000000 0.496314 0.000000
-0.068264 0.034492 0.000000 0.063882 0.000000
0.027103 0.034492 0.000000 0.737101 0.000000
-0.025906 0.033410 0.000000 0.945946 0.000000
0.069460 0.033410 0.000000 0.493858 0.000000
-0.067892 0.033410 0.000000 0.066339 0.000000
0.027475 0.033410 0.000000 0.739558 0.000000
-0.026409 0.032397 0.000000 0.943489 0.000000
0.068958 0.032397 0.000000 0.491400 0.000000
-0.067389 0.032397 0.000000 0.068796 0.000000
0.027977 0.032397 0.000000 0.742015 0.000000
-0.027032 0.031464 0.000000 0.941032 0.000000
0.068335 0.031464 0.000000 0.488943 0.000000
-0.066767 0.031464 0.000000 0.071253 0.000000
0.028600 0.031464 0.000000 0.744472 0.000000
-0.027765 0.030622 0.000000 0.938575 0.000000
0.067602 0.030622 0.000000 0.486486 0.000000
-0.066034 0.030622 0.000000 0.073710 0.000000
0.029333 0.030622 0.000000 0.746929 0.000000
-0.028597 0.029881 0.000000 0.936118 0.000000
0.066769 0.029881 0.000000 0.484029 0.000000
-0.065201 0.029881 0.000000 0.076167 0.000000
0.030165 0.029881 0.000000 0.749386 0.000000
-0.029519 0.029250 0.000000 0.933661 0.000000
0.065847 0.029250 0.000000 0.481572 0.000000
-0.064279 0.029250 0.000000 0.078624 0.000000
0.031087 0.029250 0.000000 0.751843 0.000000
-0.030520 0.028742 0.000000 0.931204 0.000000
0.064846 0.028742 0.000000 0.479115 0.000000
-0.063278 0.028742 0.000000 0.081081 0.000000
0.032089 0.028742 0.000000 0.754300 0.000000
-0.031590 0.028366 0.000000 0.928747 0.000000
0.063776 0.028366 0.000000 0.476658 0.000000
-0.062208 0.028366 0.000000 0.083538 0.000000
0.033158 0.028366 0.000000 0.756757 0.000000
-0.032718 0.028133 0.000000 0.926290 0.000000
0.062648 0.028133 0.000000 0.474201 0.000000
-0.061080 0.028133 0.000000 0.085995 0.000000
0.034287 0.028133 0.000000 0.759214 0.000000
-0.033895 0.028053 0.000000 0.923833 0.000000
0.061472 0.028053 0.000000 0.471744 0.000000
-0.059904 0.028053 0.000000 0.088452 0.000000
0.035463 0.028053 0.000000 0.761671 0.000000
-0.059904 0.027017 0.000000 0.090909 0.000000
-0.042564 0.028053 0.000000 0.921376 0.000000
-0.042564 -0.024574 0.000000 0.918919 0.000000
0.035633 0.028053 0.000000 0.764128 0.000000
0.036105 0.028053 0.000000 0.766585 0.000000
0.036817 0.028053 0.000000 0.769042 0.000000
0.037710 0.028053 0.000000 0.771499 0.000000
0.038724 0.028053 0.000000 0.773956 0.000000
0.039798 0.028053 0.000000 0.776413 0.000000
0.040871 0.028053 0.000000 0.778870 0.000000
0.041885 0.028053 0.000000 0.781327 0.000000
0.042778 0.028053 0.000000 0.783784 0.000000
0.043490 0.028053 0.000000 0.786241 0.000000
0.043962 0.028053 0.000000 0.788698 0.000000
0.044132 0.028053 0.000000 0.791155 0.000000
0.044132 -0.024574 0.000000 0.793612 0.000000
0.061472 0.027017 0.000000 0.469287 0.000000
0.061472 0.024154 0.000000 0.466830 0.000000
-0.059904 0.024154 0.000000 0.093366 0.000000
0.061472 0.019830 0.000000 0.464373 0.000000
-0.059904 0.019830 0.000000 0.095823 0.000000
0.061472 0.014409 0.000000 0.461916 0.000000
-0.059904 0.014409 0.000000 0.098280 0.000000
0.061472 0.008257 0.000000 0.459459 0.000000
-0.059904 0.008257 0.000000 0.100737 0.000000
0.061472 0.001739 0.000000 0.457002 0.000000
-0.059904 0.001739 0.000000 0.103194 0.000000
0.061472 -0.004778 0.000000 0.454545 0.000000
-0.059904 -0.004778 0.000000 0.105651 0.000000
0.061472 -0.010930 0.000000 0.452088 0.000000
-0.059904 -0.010930 0.000000 0.108108 0.000000
0.061472 -0.016351 0.000000 0.449631 0.000000
-0.059904 -0.016351 0.000000 0.110565 0.000000
0.061472 -0.020676 0.000000 0.447174 0.000000
-0.059904 -0.020676 0.000000 0.113022 0.000000
0.061472 -0.023539 0.000000 0.444717 0.000000
-0.059904 -0.023539 0.000000 0.115479 0.000000
0.061472 -0.024574 0.000000 0.442260 0.000000
-0.059904 -0.024574 0.000000 0.117936 0.000000
-0.061080 -0.024654 0.000000 0.120393 0.000000
-0.042394 -0.024574 0.000000 0.916462 0.000000
-0.041922 -0.024574 0.000000 0.914005 0.000000
-0.041210 -0.024574 0.000000 0.911548 0.000000
-0.040317 -0.024574 0.000000 0.909091 0.000000
-0.039303 -0.024574 0.000000 0.906634 0.000000
-0.038229 -0.024574 0.000000 0.904177 0.000000
-0.037156 -0.024574 0.000000 0.901720 0.000000
-0.036142 -0.024574 0.000000 0.899263 0.000000
-0.035249 -0.024574 0.000000 0.896806 0.000000
-0.034537 -0.024574 0.000000 0.894349 0.000000
-0.034065 -0.024574 0.000000 0.891892 0.000000
-0.033895 -0.024574 0.000000 0.889435 0.000000
-0.032718 -0.024654 0.000000 0.886978 0.000000
0.034287 -0.024654 0.000000 0.798526 0.000000
0.035463 -0.024574 0.000000 0.796069 0.000000
0.062648 -0.024654 0.000000 0.439803 0.000000
-0.031590 -0.024888 0.000000 0.884521 0.000000
0.063776 -0.024888 0.000000 0.437346 0.000000
-0.062208 -0.024888 0.000000 0.122850 0.000000
0.033158 -0.024888 0.000000 0.800983 0.000000
-0.030520 -0.025264 0.000000 0.882064 0.000000
0.064846 -0.025264 0.000000 0.434889 0.000000
-0.063278 -0.025264 0.000000 0.125307 0.000000
0.032089 -0.025264 0.000000 0.803440 0.000000
-0.029519 -0.025772 0.000000 0.879607 0.000000
0.065847 -0.025772 0.000000 0.432432 0.000000
-0.064279 -0.025772 0.000000 0.127764 0.000000
0.031087 -0.025772 0.000000 0.805897 0.000000
-0.028597 -0.026402 0.000000 0.877150 0.000000
0.066769 -0.026402 0.000000 0.429975 0.000000
-0.065201 -0.026402 0.000000 0.130221 0.000000
0.030165 -0.026402 0.000000 0.808354 0.000000
-0.027765 -0.027144 0.000000 0.874693 0.000000
0.067602 -0.027144 0.000000 0.427518 0.000000
-0.066034 -0.027144 0.000000 0.132678 0.000000
0.029333 -0.027144 0.000000 0.810811 0.000000
-0.027032 -0.027986 0.000000 0.872236 0.000000
0.068335 -0.027986 0.000000 0.425061 0.000000
-0.066767 -0.027986 0.000000 0.135135 0.000000
0.028600 -0.027986 0.000000 0.813268 0.000000
-0.067389 -0.028919 0.000000 0.137592 0.000000
-0.026409 -0.028919 0.000000 0.869779 0.000000
0.027977 -0.028919 0.000000 0.815725 0.000000
0.068958 -0.028919 0.000000 0.422604 0.000000
-0.067892 -0.029932 0.000000 0.140049 0.000000
-0.025906 -0.029932 0.000000 0.867322 0.000000
0.027475 -0.029932 0.000000 0.818182 0.000000
0.069460 -0.029932 0.000000 0.420147 0.000000
-0.068263 -0.031014 0.000000 0.142506 0.000000
-0.025535 -0.031014 0.000000 0.864865 0.000000
0.027103 -0.031014 0.000000 0.820639 0.000000
0.069832 -0.031014 0.000000 0.417690 0.000000
-0.068494 -0.032156 0.000000 0.144963 0.000000
-0.025304 -0.032156 0.000000 0.862408 0.000000
0.026872 -0.032156 0.000000 0.823096 0.000000
0.070062 -0.032156 0.000000 0.415233 0.000000
-0.068573 -0.033346 0.000000 0.147420 0.000000
-0.025225 -0.033346 0.000000 0.859951 0.000000
0.026793 -0.033346 0.000000 0.825553 0.000000
0.070141 -0.033346 0.000000 0.412776 0.000000
-0.068573 -0.033863 0.000000 0.149877 0.000000
-0.036289 -0.036815 0.000000 0.985258 0.000000
-0.025225 -0.042117 0.000000 0.857494 0.000000
0.026793 -0.033518 0.000000 0.828010 0.000000
0.070141 -0.033863 0.000000 0.410319 0.000000
0.026793 -0.033995 0.000000 0.830467 0.000000
0.070141 -0.035295 0.000000 0.407862 0.000000
-0.068573 -0.035295 0.000000 0.152334 0.000000
0.026793 -0.034716 0.000000 0.832924 0.000000
0.026793 -0.035620 0.000000 0.835381 0.000000
0.059807 -0.036815 0.000000 0.995086 0.000000
0.070141 -0.037457 0.000000 0.405405 0.000000
-0.068573 -0.037457 0.000000 0.154791 0.000000
-0.057876 -0.036815 0.000000 0.982801 0.000000
0.026793 -0.036645 0.000000 0.837838 0.000000
0.026793 -0.037731 0.000000 0.840295 0.000000
0.038220 -0.036815 0.000000 0.992629 0.000000
-0.057876 -0.058370 0.000000 0.990172 0.000000
-0.036289 -0.058370 0.000000 0.987715 0.000000
0.038220 -0.058370 0.000000 1.000000 0.000000
0.059807 -0.058370 0.000000 0.997543 0.000000
0.070141 -0.040168 0.000000 0.402948 0.000000
-0.068573 -0.040168 0.000000 0.157248 0.000000
0.026793 -0.038817 0.000000 0.842752 0.000000
0.026793 -0.039843 0.000000 0.845209 0.000000
0.026793 -0.040746 0.000000 0.847666 0.000000
0.070141 -0.043244 0.000000 0.400491 0.000000
-0.068573 -0.043244 0.000000 0.159705 0.000000
0.026793 -0.041467 0.000000 0.850123 0.000000
0.026793 -0.041944 0.000000 0.852580 0.000000
0.026793 -0.042117 0.000000 0.855037 0.000000
0.070141 -0.046502 0.000000 0.398034 0.000000
-0.068573 -0.046502 0.000000 0.162162 0.000000
0.070141 -0.049761 0.000000 0.395577 0.000000
-0.068573 -0.049761 0.000000 0.164619 0.000000
0.070141 -0.052837 0.000000 0.393120 0.000000
-0.068573 -0.052837 0.000000 0.167076 0.000000
0.070141 -0.055548 0.000000 0.390663 0.000000
-0.068573 -0.055548 0.000000 0.169533 0.000000
0.070141 -0.057710 0.000000 0.388206 0.000000
-0.068573 -0.057710 0.000000 0.171990 0.000000
0.070141 -0.059141 0.000000 0.385749 0.000000
-0.068573 -0.059141 0.000000 0.174447 0.000000
-0.068573 -0.059659 0.000000 0.176904 0.000000
0.070141 -0.059659 0.000000 0.383292 0.000000
-0.068494 -0.060849 0.000000 0.179361 0.000000
-0.025225 -0.059659 0.000000 0.265356 0.000000
-0.025304 -0.060849 0.000000 0.262899 0.000000
-0.024201 -0.059659 0.000000 0.267813 0.000000
-0.021372 -0.059659 0.000000 0.270270 0.000000
-0.017097 -0.059659 0.000000 0.272727 0.000000
-0.011739 -0.059659 0.000000 0.275184 0.000000
-0.005658 -0.059659 0.000000 0.277641 0.000000
0.000784 -0.059659 0.000000 0.280098 0.000000
0.007226 -0.059659 0.000000 0.282555 0.000000
0.013307 -0.059659 0.000000 0.285012 0.000000
0.018665 -0.059659 0.000000 0.287469 0.000000
0.022940 -0.059659 0.000000 0.289926 0.000000
0.025770 -0.059659 0.000000 0.292383 0.000000
0.026793 -0.059659 0.000000 0.294840 0.000000
0.026872 -0.060849 0.000000 0.297297 0.000000
0.070062 -0.060849 0.000000 0.380835 0.000000
-0.068264 -0.061991 0.000000 0.181818 0.000000
0.027103 -0.061991 0.000000 0.299754 0.000000
-0.025535 -0.061991 0.000000 0.260442 0.000000
0.069832 -0.061991 0.000000 0.378378 0.000000
-0.067892 -0.063073 0.000000 0.184275 0.000000
0.027475 -0.063073 0.000000 0.302211 0.000000
-0.025906 -0.063073 0.000000 0.257985 0.000000
0.069460 -0.063073 0.000000 0.375921 0.000000
-0.067389 -0.064086 0.000000 0.186732 0.000000
0.027977 -0.064086 0.000000 0.304668 0.000000
-0.026409 -0.064086 0.000000 0.255528 0.000000
0.068958 -0.064086 0.000000 0.373464 0.000000
-0.066767 -0.065019 0.000000 0.189189 0.000000
0.028600 -0.065019 0.000000 0.307125 0.000000
-0.027032 -0.065019 0.000000 0.253071 0.000000
0.068335 -0.065019 0.000000 0.371007 0.000000
-0.066034 -0.065861 0.000000 0.191646 0.000000
0.029333 -0.065861 0.000000 0.309582 0.000000
-0.027765 -0.065861 0.000000 0.250614 0.000000
0.067602 -0.065861 0.000000 0.368550 0.000000
-0.065201 -0.066602 0.000000 0.194103 0.000000
0.030165 -0.066602 0.000000 0.312039 0.000000
-0.028597 -0.066602 0.000000 0.248157 0.000000
0.066769 -0.066602 0.000000 0.366093 0.000000
-0.064279 -0.067233 0.000000 0.196560 0.000000
0.031087 -0.067233 0.000000 0.314496 0.000000
-0.029519 -0.067233 0.000000 0.245700 0.000000
0.065847 -0.067233 0.000000 0.363636 0.000000
-0.063278 -0.067741 0.000000 0.199017 0.000000
0.032089 -0.067741 0.000000 0.316953 0.000000
-0.030520 -0.067741 0.000000 0.243243 0.000000
0.064846 -0.067741 0.000000 0.361179 0.000000
-0.062208 -0.068117 0.000000 0.201474 0.000000
0.033158 -0.068117 0.000000 0.319410 0.000000
-0.031590 -0.068117 0.000000 0.240786 0.000000
0.063776 -0.068117 0.000000 0.358722 0.000000
-0.061080 -0.068350 0.000000 0.203931 0.000000
0.034287 -0.068350 0.000000 0.321867 0.000000
-0.032718 -0.068350 0.000000 0.238329 0.000000
0.062648 -0.068350 0.000000 0.356265 0.000000
-0.059904 -0.068430 0.000000 0.206388 0.000000
0.035463 -0.068430 0.000000 0.324324 0.000000
-0.033895 -0.068430 0.000000 0.235872 0.000000
0.061472 -0.068430 0.000000 0.353808 0.000000
-0.059392 -0.068430 0.000000 0.208845 0.000000
-0.057977 -0.068430 0.000000 0.211302 0.000000
-0.055840 -0.068430 0.000000 0.213759 0.000000
-0.053161 -0.068430 0.000000 0.216216 0.000000
-0.050120 -0.068430 0.000000 0.218673 0.000000
-0.046899 -0.068430 0.000000 0.221130 0.000000
-0.043678 -0.068430 0.000000 0.223587 0.000000
-0.040638 -0.068430 0.000000 0.226044 0.000000
-0.037958 -0.068430 0.000000 0.228501 0.000000
-0.035821 -0.068430 0.000000 0.230958 0.000000
-0.034406 -0.068430 0.000000 0.233415 0.000000
0.035975 -0.068430 0.000000 0.326781 0.000000
0.037389 -0.068430 0.000000 0.329238 0.000000
0.039527 -0.068430 0.000000 0.331695 0.000000
0.042206 -0.068430 0.000000 0.334152 0.000000
0.045246 -0.068430 0.000000 0.336609 0.000000
0.048467 -0.068430 0.000000 0.339066 0.000000
0.051688 -0.068430 0.000000 0.341523 0.000000
0.054729 -0.068430 0.000000 0.343980 0.000000
0.057408 -0.068430 0.000000 0.346437 0.000000
0.059545 -0.068430 0.000000 0.348894 0.000000
0.060960 -0.068430 0.000000 0.351351 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 16 17
3 15 18 16
3 15 19 18
3 15 20 19
3 15 21 20
3 15 22 21
3 15 23 22
3 15 24 23
3 15 25 24
3 15 26 25
3 15 27 26
3 15 28 27
3 15 29 28
3 30 14 0
3 31 29 15
3 30 32 14
3 31 33 29
3 34 32 30
3 35 33 31
3 34 36 32
3 35 37 33
3 38 36 34
3 39 37 35
3 38 40 36
3 39 41 37
3 42 40 38
3 43 41 39
3 42 44 40
3 43 45 41
3 46 44 42
3 47 45 43
3 46 48 44
3 47 49 45
3 50 48 46
3 51 49 47
3 50 52 48
3 51 53 49
3 54 52 50
3 55 53 51
3 54 56 52
3 55 57 53
3 58 56 54
3 59 57 55
3 58 60 56
3 59 61 57
3 62 60 58
3 63 61 59
3 62 64 60
3 63 65 61
3 66 64 62
3 67 65 63
3 66 68 64
3 67 69 65
3 70 68 66
3 71 69 67
3 70 72 68
3 71 73 69
3 74 72 70
3 74 75 72
3 74 76 75
3 74 77 76
3 74 78 77
3 74 79 78
3 74 80 79
3 74 81 80
3 74 82 81
3 74 83 82
3 74 84 83
3 74 85 84
3 74 71 85
3 74 73 71
3 74 86 73
3 74 87 86
3 88 87 74
3 88 89 87
3 89 90 87
3 91 92 88
3 92 89 88
3 91 93 92
3 94 89 92
3 95 96 94
3 96 97 94
3 97 89 94
3 96 98 97
3 98 99 97
3 100 90 89
3 100 101 90
3 102 93 91
3 100 103 101
3 104 93 102
3 100 105 103
3 106 93 104
3 100 107 105
3 108 93 106
3 100 109 107
3 110 93 108
3 95 111 96
3 112 99 98
3 95 113 111
3 95 114 113
3 95 115 114
3 100 116 109
3 117 93 110
3 95 118 115
3 95 119 118
3 95 120 119
3 100 121 116
3 122 93 117
3 95 123 120
3 122 95 93
3 122 123 95
3 112 100 99
3 112 121 100
3 122 124 123
3 112 125 121
3 126 124 122
3 126 127 124
3 126 128 127
3 112 129 125
3 130 128 126
3 130 131 128
3 132 131 130
3 132 133 131
3 134 129 112
3 134 135 129
3 132 136 133
3 134 137 135
3 138 136 132
3 139 137 134
3 138 140 136
3 139 141 137
3 142 140 138
3 143 141 139
3 142 144 140
3 143 145 141
3 146 144 142
3 147 145 143
3 146 148 144
3 147 149 145
3 150 148 146
3 151 149 147
3 150 152 148
3 151 153 149
3 154 152 150
3 155 153 151
3 154 156 152
3 155 157 153
3 158 156 154
3 159 157 155
3 158 160 156
3 159 161 157
3 162 160 158
3 163 161 159
3 162 164 160
3 163 165 161
3 166 164 162
3 167 165 163
3 166 168 164
3 167 169 165
3 170 168 166
3 171 169 167
3 170 172 168
3 171 173 169
3 174 172 170
3 175 173 171
3 174 176 172
3 175 177 173
3 178 176 174
3 179 177 175
3 180 181 178
3 181 176 178
3 180 182 181
3 183 177 179
3 184 177 183
3 185 177 184
3 186 177 185
3 187 177 186
3 188 177 187
3 189 177 188
3 190 177 189
3 191 177 190
3 192 177 191
3 193 177 192
3 194 177 193
3 195 177 194
3 195 196 177
3 195 197 196
3 198 182 180
3 195 199 197
3 200 182 198
3 195 201 199
3 202 182 200
3 195 203 201
3 204 182 202
3 195 205 203
3 206 182 204
3 195 207 205
3 208 182 206
3 195 209 207
3 210 182 208
3 195 211 209
3 212 182 210
3 195 213 211
3 214 182 212
3 195 215 213
3 216 182 214
3 195 217 215
3 218 182 216
3 219 182 218
3 219 220 182
3 219 221 220
3 219 222 221
3 219 223 222
3 219 224 223
3 219 225 224
3 219 226 225
3 219 227 226
3 219 228 227
3 219 229 228
3 219 230 229
3 219 231 230
3 219 232 231
3 233 195 234
3 233 217 195
3 233 235 217
3 219 236 232
3 233 237 235
3 238 236 219
3 239 237 233
3 238 240 236
3 239 241 237
3 242 240 238
3 243 241 239
3 242 244 240
3 243 245 241
3 246 244 242
3 247 245 243
3 246 248 244
3 247 249 245
3 250 248 246
3 251 249 247
3 250 252 248
3 251 253 249
3 254 252 250
3 255 253 251
3 254 256 252
3 255 257 253
3 258 256 254
3 259 257 255
3 260 256 258
3 260 261 256
3 262 257 259
3 262 263 257
3 264 261 260
3 264 265 261
3 266 263 262
3 266 267 263
3 268 265 264
3 268 269 265
3 270 267 266
3 270 271 267
3 272 269 268
3 272 273 269
3 274 271 270
3 274 275 271
3 276 273 272
3 276 277 273
3 278 275 274
3 278 279 275
3 280 277 276
3 280 281 277
3 281 282 277
3 283 279 278
3 283 284 279
3 285 284 283
3 285 286 284
3 287 281 280
3 288 286 285
3 289 286 288
3 289 290 286
3 290 291 286
3 292 293 287
3 293 281 287
3 294 290 289
3 295 296 294
3 296 290 294
3 292 297 293
3 298 282 281
3 295 299 296
3 300 291 290
3 300 301 291
3 302 297 292
3 303 299 295
3 304 299 303
3 305 299 304
3 300 306 301
3 307 297 302
3 308 299 305
3 309 299 308
3 310 299 309
3 298 310 282
3 298 299 310
3 300 311 306
3 312 297 307
3 300 313 311
3 314 297 312
3 300 315 313
3 316 297 314
3 300 317 315
3 318 297 316
3 300 319 317
3 320 297 318
3 300 321 319
3 322 297 320
3 322 298 297
3 322 299 298
3 322 300 299
3 322 321 300
3 323 321 322
3 323 324 321
3 325 326 323
3 326 324 323
3 325 327 326
3 328 324 326
3 329 324 328
3 330 324 329
3 331 324 330
3 332 324 331
3 333 324 332
3 334 324 333
3 335 324 334
3 336 324 335
3 337 324 336
3 338 324 337
3 339 324 338
3 340 324 339
3 340 341 324
3 342 327 325
3 343 341 340
3 342 344 327
3 343 345 341
3 346 344 342
3 347 345 343
3 346 348 344
3 347 349 345
3 350 348 346
3 351 349 347
3 350 352 348
3 351 353 349
3 354 352 350
3 355 353 351
3 354 356 352
3 355 357 353
3 358 356 354
3 359 357 355
3 358 360 356
3 359 361 357
3 362 360 358
3 363 361 359
3 362 364 360
3 363 365 361
3 366 364 362
3 367 365 363
3 366 368 364
3 367 369 365
3 370 368 366
3 371 369 367
3 370 372 368
3 371 373 369
3 374 372 370
3 375 373 371
3 374 376 372
3 375 377 373
3 378 376 374
3 379 377 375
3 378 380 376
3 379 381 377
3 382 380 378
3 383 381 379
3 382 384 380
3 383 385 381
3 386 384 382
3 387 384 386
3 388 384 387
3 389 384 388
3 390 384 389
3 391 384 390
3 392 384 391
3 393 384 392
3 394 384 393
3 395 384 394
3 396 384 395
3 397 385 383
3 398 385 397
3 399 385 398
3 400 385 399
3 401 385 400
3 402 385 401
3 403 385 402
3 404 385 403
3 405 385 404
3 406 385 405
3 407 385 406

View File

@@ -1,21 +1,23 @@
ply
format ascii 1.0
comment Created by Blender 2.82 (sub 7) - www.blender.org, source file: 'border_large_sharp_2.blend'
comment Created by Blender 3.6.2 - www.blender.org
element vertex 8
property float x
property float y
property float z
property float s
property float t
element face 8
property list uchar uint vertex_indices
end_header
0.994343 0.997469 0.000000
0.795365 -0.793329 0.000000
0.994343 -0.992306 0.000000
-0.796455 -0.793329 0.000000
-0.995432 -0.992306 0.000000
-0.995432 0.997469 0.000000
-0.796454 0.798491 0.000000
0.795366 0.798491 0.000000
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
3 0 1 2
3 2 3 4
3 3 5 4

607
rsc/mesh/icon_magnet.ply Normal file
View File

@@ -0,0 +1,607 @@
ply
format ascii 1.0
comment Created by Blender 3.6.2 - www.blender.org
element vertex 302
property float x
property float y
property float z
property float nx
property float ny
property float nz
property float s
property float t
element face 290
property list uchar uint vertex_indices
end_header
-0.007533 0.129787 0.000000 0.000000 0.000000 1.000000 0.232558 0.000000
-0.005399 0.129663 0.000000 0.000000 0.000000 1.000000 0.225914 0.000000
-0.006301 0.130781 0.000000 0.000000 0.000000 1.000000 0.229236 0.000000
-0.011014 0.126977 0.000000 0.000000 0.000000 1.000000 0.235880 0.000000
-0.002908 0.126571 0.000000 0.000000 0.000000 1.000000 0.222591 0.000000
-0.016421 0.122611 0.000000 0.000000 0.000000 1.000000 0.239203 0.000000
0.000856 0.121901 0.000000 0.000000 0.000000 1.000000 0.219269 0.000000
0.050520 0.123496 0.000000 0.000000 0.000000 1.000000 0.956811 0.000000
0.087661 0.113801 0.000000 0.000000 0.000000 1.000000 0.950166 0.000000
0.086803 0.126056 0.000000 0.000000 0.000000 1.000000 0.953488 0.000000
0.051378 0.111241 0.000000 0.000000 0.000000 1.000000 0.960133 0.000000
-0.023433 0.116948 0.000000 0.000000 0.000000 1.000000 0.242525 0.000000
0.005574 0.116046 0.000000 0.000000 0.000000 1.000000 0.215947 0.000000
-0.031724 0.110247 0.000000 0.000000 0.000000 1.000000 0.245847 0.000000
0.010928 0.109402 0.000000 0.000000 0.000000 1.000000 0.212625 0.000000
-0.040974 0.102768 0.000000 0.000000 0.000000 1.000000 0.249169 0.000000
0.016601 0.102363 0.000000 0.000000 0.000000 1.000000 0.209302 0.000000
-0.050860 0.094770 0.000000 0.000000 0.000000 1.000000 0.252492 0.000000
0.022273 0.095324 0.000000 0.000000 0.000000 1.000000 0.205980 0.000000
0.027627 0.088680 0.000000 0.000000 0.000000 1.000000 0.202658 0.000000
-0.061057 0.086512 0.000000 0.000000 0.000000 1.000000 0.255814 0.000000
0.032345 0.082826 0.000000 0.000000 0.000000 1.000000 0.199336 0.000000
0.111291 0.051246 0.000000 0.000000 0.000000 1.000000 0.963455 0.000000
0.125918 0.086745 0.000000 0.000000 0.000000 1.000000 0.970100 0.000000
0.113647 0.087548 0.000000 0.000000 0.000000 1.000000 0.973422 0.000000
0.123562 0.050456 0.000000 0.000000 0.000000 1.000000 0.966777 0.000000
-0.071245 0.078253 0.000000 0.000000 0.000000 1.000000 0.259136 0.000000
-0.027234 0.084757 0.000000 0.000000 0.000000 1.000000 0.627907 0.000000
-0.031745 0.081099 0.000000 0.000000 0.000000 1.000000 0.624585 0.000000
-0.026900 0.084328 0.000000 0.000000 0.000000 1.000000 0.631229 0.000000
-0.025976 0.083144 0.000000 0.000000 0.000000 1.000000 0.634551 0.000000
-0.024580 0.081355 0.000000 0.000000 0.000000 1.000000 0.637874 0.000000
0.036109 0.078155 0.000000 0.000000 0.000000 1.000000 0.196013 0.000000
-0.022831 0.079112 0.000000 0.000000 0.000000 1.000000 0.641196 0.000000
-0.036434 0.077297 0.000000 0.000000 0.000000 1.000000 0.621262 0.000000
-0.020845 0.076567 0.000000 0.000000 0.000000 1.000000 0.644518 0.000000
-0.081100 0.070253 0.000000 0.000000 0.000000 1.000000 0.262458 0.000000
0.038601 0.075063 0.000000 0.000000 0.000000 1.000000 0.192691 0.000000
-0.041260 0.073383 0.000000 0.000000 0.000000 1.000000 0.617940 0.000000
-0.018742 0.073870 0.000000 0.000000 0.000000 1.000000 0.647841 0.000000
0.039502 0.073945 0.000000 0.000000 0.000000 1.000000 0.189369 0.000000
0.038591 0.073213 0.000000 0.000000 0.000000 1.000000 0.186047 0.000000
-0.016639 0.071174 0.000000 0.000000 0.000000 1.000000 0.651163 0.000000
-0.046182 0.069390 0.000000 0.000000 0.000000 1.000000 0.614618 0.000000
0.035958 0.071094 0.000000 0.000000 0.000000 1.000000 0.182724 0.000000
-0.014653 0.068628 0.000000 0.000000 0.000000 1.000000 0.654485 0.000000
0.031754 0.067708 0.000000 0.000000 0.000000 1.000000 0.179402 0.000000
-0.090298 0.062771 0.000000 0.000000 0.000000 1.000000 0.265781 0.000000
-0.051160 0.065350 0.000000 0.000000 0.000000 1.000000 0.611296 0.000000
-0.012904 0.066386 0.000000 0.000000 0.000000 1.000000 0.657807 0.000000
0.026130 0.063174 0.000000 0.000000 0.000000 1.000000 0.176080 0.000000
-0.011508 0.064596 0.000000 0.000000 0.000000 1.000000 0.661130 0.000000
-0.056153 0.061295 0.000000 0.000000 0.000000 1.000000 0.607973 0.000000
-0.010584 0.063412 0.000000 0.000000 0.000000 1.000000 0.664452 0.000000
-0.010250 0.062984 0.000000 0.000000 0.000000 1.000000 0.667774 0.000000
0.019234 0.057609 0.000000 0.000000 0.000000 1.000000 0.172757 0.000000
-0.014008 0.059940 0.000000 0.000000 0.000000 1.000000 0.671096 0.000000
-0.098519 0.056066 0.000000 0.000000 0.000000 1.000000 0.269103 0.000000
-0.061121 0.057259 0.000000 0.000000 0.000000 1.000000 0.604651 0.000000
-0.017960 0.056737 0.000000 0.000000 0.000000 1.000000 0.674419 0.000000
0.011219 0.051134 0.000000 0.000000 0.000000 1.000000 0.169435 0.000000
-0.066023 0.053273 0.000000 0.000000 0.000000 1.000000 0.601329 0.000000
-0.022099 0.053380 0.000000 0.000000 0.000000 1.000000 0.677741 0.000000
-0.106740 0.048827 0.000000 0.000000 0.000000 1.000000 0.272425 0.000000
-0.026416 0.049876 0.000000 0.000000 0.000000 1.000000 0.681063 0.000000
-0.070819 0.049370 0.000000 0.000000 0.000000 1.000000 0.598007 0.000000
0.002235 0.043865 0.000000 0.000000 0.000000 1.000000 0.166113 0.000000
-0.030903 0.046232 0.000000 0.000000 0.000000 1.000000 0.684385 0.000000
-0.075468 0.045583 0.000000 0.000000 0.000000 1.000000 0.594684 0.000000
-0.113875 0.041492 0.000000 0.000000 0.000000 1.000000 0.275748 0.000000
-0.035550 0.042455 0.000000 0.000000 0.000000 1.000000 0.687708 0.000000
-0.079930 0.041945 0.000000 0.000000 0.000000 1.000000 0.591362 0.000000
-0.007569 0.035923 0.000000 0.000000 0.000000 1.000000 0.162791 0.000000
-0.040350 0.038550 0.000000 0.000000 0.000000 1.000000 0.691030 0.000000
-0.084164 0.038487 0.000000 0.000000 0.000000 1.000000 0.588040 0.000000
-0.119995 0.034109 0.000000 0.000000 0.000000 1.000000 0.279070 0.000000
0.000169 -0.052404 0.000000 0.000000 0.000000 1.000000 0.029900 0.000000
0.075529 0.038158 0.000000 0.000000 0.000000 1.000000 0.465116 0.000000
0.074409 0.039059 0.000000 0.000000 0.000000 1.000000 0.026578 0.000000
-0.045294 0.034524 0.000000 0.000000 0.000000 1.000000 0.694352 0.000000
-0.089537 0.033832 0.000000 0.000000 0.000000 1.000000 0.584718 0.000000
0.078626 0.035667 0.000000 0.000000 0.000000 1.000000 0.461794 0.000000
-0.018042 0.027426 0.000000 0.000000 0.000000 1.000000 0.159468 0.000000
0.083304 0.031904 0.000000 0.000000 0.000000 1.000000 0.458472 0.000000
-0.050373 0.030383 0.000000 0.000000 0.000000 1.000000 0.697674 0.000000
-0.125169 0.026725 0.000000 0.000000 0.000000 1.000000 0.282392 0.000000
-0.094466 0.029007 0.000000 0.000000 0.000000 1.000000 0.581395 0.000000
0.089169 0.027187 0.000000 0.000000 0.000000 1.000000 0.455150 0.000000
-0.055579 0.026135 0.000000 0.000000 0.000000 1.000000 0.700997 0.000000
-0.098945 0.024023 0.000000 0.000000 0.000000 1.000000 0.578073 0.000000
-0.029033 0.018492 0.000000 0.000000 0.000000 1.000000 0.156146 0.000000
0.095824 0.021834 0.000000 0.000000 0.000000 1.000000 0.451827 0.000000
-0.129470 0.019389 0.000000 0.000000 0.000000 1.000000 0.285714 0.000000
-0.060902 0.021785 0.000000 0.000000 0.000000 1.000000 0.704319 0.000000
-0.102972 0.018887 0.000000 0.000000 0.000000 1.000000 0.574751 0.000000
0.102874 0.016163 0.000000 0.000000 0.000000 1.000000 0.448505 0.000000
-0.066336 0.017340 0.000000 0.000000 0.000000 1.000000 0.707641 0.000000
-0.132968 0.012147 0.000000 0.000000 0.000000 1.000000 0.289037 0.000000
-0.106541 0.013607 0.000000 0.000000 0.000000 1.000000 0.571429 0.000000
-0.040391 0.009240 0.000000 0.000000 0.000000 1.000000 0.152824 0.000000
-0.071072 0.013102 0.000000 0.000000 0.000000 1.000000 0.710963 0.000000
0.063472 -0.010424 0.000000 0.000000 0.000000 1.000000 0.906977 0.000000
0.109924 0.010491 0.000000 0.000000 0.000000 1.000000 0.445183 0.000000
-0.109648 0.008192 0.000000 0.000000 0.000000 1.000000 0.568106 0.000000
-0.075258 0.008590 0.000000 0.000000 0.000000 1.000000 0.714286 0.000000
-0.135733 0.005048 0.000000 0.000000 0.000000 1.000000 0.292359 0.000000
0.116579 0.005138 0.000000 0.000000 0.000000 1.000000 0.441860 0.000000
-0.051967 -0.000212 0.000000 0.000000 0.000000 1.000000 0.149502 0.000000
-0.078887 0.003829 0.000000 0.000000 0.000000 1.000000 0.717608 0.000000
-0.112288 0.002650 0.000000 0.000000 0.000000 1.000000 0.564784 0.000000
0.122444 0.000421 0.000000 0.000000 0.000000 1.000000 0.438538 0.000000
-0.137837 -0.001862 0.000000 0.000000 0.000000 1.000000 0.295681 0.000000
-0.081950 -0.001152 0.000000 0.000000 0.000000 1.000000 0.720930 0.000000
-0.114459 -0.003011 0.000000 0.000000 0.000000 1.000000 0.561462 0.000000
0.127122 -0.003342 0.000000 0.000000 0.000000 1.000000 0.435216 0.000000
-0.055834 -0.003730 0.000000 0.000000 0.000000 1.000000 0.146179 0.000000
-0.084439 -0.006328 0.000000 0.000000 0.000000 1.000000 0.724252 0.000000
-0.139350 -0.008535 0.000000 0.000000 0.000000 1.000000 0.299003 0.000000
-0.116154 -0.008781 0.000000 0.000000 0.000000 1.000000 0.558140 0.000000
0.130219 -0.005833 0.000000 0.000000 0.000000 1.000000 0.431894 0.000000
-0.058958 -0.007294 0.000000 0.000000 0.000000 1.000000 0.142857 0.000000
0.131339 -0.006734 0.000000 0.000000 0.000000 1.000000 0.428571 0.000000
-0.086346 -0.011672 0.000000 0.000000 0.000000 1.000000 0.727575 0.000000
0.130343 -0.007967 0.000000 0.000000 0.000000 1.000000 0.425249 0.000000
-0.061406 -0.010868 0.000000 0.000000 0.000000 1.000000 0.139535 0.000000
0.127530 -0.011450 0.000000 0.000000 0.000000 1.000000 0.421927 0.000000
-0.140343 -0.014923 0.000000 0.000000 0.000000 1.000000 0.302326 0.000000
-0.117371 -0.014653 0.000000 0.000000 0.000000 1.000000 0.554817 0.000000
0.062573 -0.011532 0.000000 0.000000 0.000000 1.000000 0.903654 0.000000
0.084882 -0.028044 0.000000 0.000000 0.000000 1.000000 0.910299 0.000000
-0.063242 -0.014421 0.000000 0.000000 0.000000 1.000000 0.136213 0.000000
0.123158 -0.016861 0.000000 0.000000 0.000000 1.000000 0.418605 0.000000
0.060088 -0.014594 0.000000 0.000000 0.000000 1.000000 0.900332 0.000000
-0.087664 -0.017156 0.000000 0.000000 0.000000 1.000000 0.730897 0.000000
-0.064531 -0.017920 0.000000 0.000000 0.000000 1.000000 0.132890 0.000000
0.056333 -0.019220 0.000000 0.000000 0.000000 1.000000 0.897010 0.000000
-0.118104 -0.020618 0.000000 0.000000 0.000000 1.000000 0.551495 0.000000
-0.140887 -0.020979 0.000000 0.000000 0.000000 1.000000 0.305648 0.000000
0.117486 -0.023875 0.000000 0.000000 0.000000 1.000000 0.415282 0.000000
-0.088384 -0.022755 0.000000 0.000000 0.000000 1.000000 0.734219 0.000000
-0.065340 -0.021331 0.000000 0.000000 0.000000 1.000000 0.129568 0.000000
0.051626 -0.025018 0.000000 0.000000 0.000000 1.000000 0.893688 0.000000
-0.118349 -0.026669 0.000000 0.000000 0.000000 1.000000 0.548173 0.000000
-0.141053 -0.026655 0.000000 0.000000 0.000000 1.000000 0.308970 0.000000
-0.065733 -0.024622 0.000000 0.000000 0.000000 1.000000 0.126246 0.000000
-0.088499 -0.028442 0.000000 0.000000 0.000000 1.000000 0.737542 0.000000
0.110775 -0.032171 0.000000 0.000000 0.000000 1.000000 0.411960 0.000000
-0.065775 -0.027760 0.000000 0.000000 0.000000 1.000000 0.122924 0.000000
0.046284 -0.031598 0.000000 0.000000 0.000000 1.000000 0.890365 0.000000
-0.139942 -0.041548 0.000000 0.000000 0.000000 1.000000 0.312292 0.000000
-0.117442 -0.038437 0.000000 0.000000 0.000000 1.000000 0.544850 0.000000
-0.065533 -0.030711 0.000000 0.000000 0.000000 1.000000 0.119601 0.000000
0.081247 -0.032538 0.000000 0.000000 0.000000 1.000000 0.913621 0.000000
-0.088000 -0.034189 0.000000 0.000000 0.000000 1.000000 0.740864 0.000000
-0.065071 -0.033444 0.000000 0.000000 0.000000 1.000000 0.116279 0.000000
0.040626 -0.038570 0.000000 0.000000 0.000000 1.000000 0.887043 0.000000
0.103284 -0.041424 0.000000 0.000000 0.000000 1.000000 0.408638 0.000000
0.077470 -0.037203 0.000000 0.000000 0.000000 1.000000 0.916944 0.000000
-0.064454 -0.035925 0.000000 0.000000 0.000000 1.000000 0.112957 0.000000
-0.086880 -0.039971 0.000000 0.000000 0.000000 1.000000 0.744186 0.000000
-0.063748 -0.038120 0.000000 0.000000 0.000000 1.000000 0.109635 0.000000
0.073585 -0.042000 0.000000 0.000000 0.000000 1.000000 0.920266 0.000000
-0.062089 -0.042090 0.000000 0.000000 0.000000 1.000000 0.106312 0.000000
-0.114819 -0.049952 0.000000 0.000000 0.000000 1.000000 0.541528 0.000000
0.034967 -0.045541 0.000000 0.000000 0.000000 1.000000 0.883721 0.000000
-0.085131 -0.045759 0.000000 0.000000 0.000000 1.000000 0.747508 0.000000
0.095272 -0.051312 0.000000 0.000000 0.000000 1.000000 0.405316 0.000000
-0.136725 -0.056045 0.000000 0.000000 0.000000 1.000000 0.315615 0.000000
0.069622 -0.046889 0.000000 0.000000 0.000000 1.000000 0.923588 0.000000
-0.060038 -0.045865 0.000000 0.000000 0.000000 1.000000 0.102990 0.000000
0.029625 -0.052121 0.000000 0.000000 0.000000 1.000000 0.880399 0.000000
-0.082561 -0.051916 0.000000 0.000000 0.000000 1.000000 0.750831 0.000000
-0.057633 -0.049417 0.000000 0.000000 0.000000 1.000000 0.099668 0.000000
0.065614 -0.051831 0.000000 0.000000 0.000000 1.000000 0.926910 0.000000
-0.054911 -0.052716 0.000000 0.000000 0.000000 1.000000 0.096346 0.000000
-0.110626 -0.061066 0.000000 0.000000 0.000000 1.000000 0.538206 0.000000
0.087000 -0.061511 0.000000 0.000000 0.000000 1.000000 0.401993 0.000000
0.061591 -0.056786 0.000000 0.000000 0.000000 1.000000 0.930233 0.000000
-0.079388 -0.057745 0.000000 0.000000 0.000000 1.000000 0.754153 0.000000
0.024918 -0.057920 0.000000 0.000000 0.000000 1.000000 0.877076 0.000000
-0.001767 -0.054660 0.000000 0.000000 0.000000 1.000000 0.033223 0.000000
-0.051910 -0.055734 0.000000 0.000000 0.000000 1.000000 0.093023 0.000000
-0.003755 -0.056722 0.000000 0.000000 0.000000 1.000000 0.036545 0.000000
-0.048668 -0.058443 0.000000 0.000000 0.000000 1.000000 0.089701 0.000000
-0.131573 -0.069976 0.000000 0.000000 0.000000 1.000000 0.318937 0.000000
-0.005793 -0.058591 0.000000 0.000000 0.000000 1.000000 0.039867 0.000000
0.057587 -0.061714 0.000000 0.000000 0.000000 1.000000 0.933555 0.000000
-0.075665 -0.063206 0.000000 0.000000 0.000000 1.000000 0.757475 0.000000
0.021164 -0.062546 0.000000 0.000000 0.000000 1.000000 0.873754 0.000000
-0.045222 -0.060814 0.000000 0.000000 0.000000 1.000000 0.086379 0.000000
-0.007880 -0.060265 0.000000 0.000000 0.000000 1.000000 0.043189 0.000000
-0.010016 -0.061744 0.000000 0.000000 0.000000 1.000000 0.046512 0.000000
-0.041610 -0.062818 0.000000 0.000000 0.000000 1.000000 0.083056 0.000000
-0.105009 -0.071633 0.000000 0.000000 0.000000 1.000000 0.534884 0.000000
0.078725 -0.071699 0.000000 0.000000 0.000000 1.000000 0.398671 0.000000
0.053632 -0.066575 0.000000 0.000000 0.000000 1.000000 0.936877 0.000000
-0.012200 -0.063027 0.000000 0.000000 0.000000 1.000000 0.049834 0.000000
0.018678 -0.065608 0.000000 0.000000 0.000000 1.000000 0.870432 0.000000
-0.037869 -0.064427 0.000000 0.000000 0.000000 1.000000 0.079734 0.000000
-0.014430 -0.064114 0.000000 0.000000 0.000000 1.000000 0.053156 0.000000
-0.071447 -0.068260 0.000000 0.000000 0.000000 1.000000 0.760797 0.000000
-0.016706 -0.065005 0.000000 0.000000 0.000000 1.000000 0.056478 0.000000
-0.034038 -0.065611 0.000000 0.000000 0.000000 1.000000 0.076412 0.000000
-0.019028 -0.065699 0.000000 0.000000 0.000000 1.000000 0.059801 0.000000
0.017779 -0.066716 0.000000 0.000000 0.000000 1.000000 0.867110 0.000000
-0.030153 -0.066343 0.000000 0.000000 0.000000 1.000000 0.073090 0.000000
-0.021393 -0.066195 0.000000 0.000000 0.000000 1.000000 0.063123 0.000000
-0.023802 -0.066493 0.000000 0.000000 0.000000 1.000000 0.066445 0.000000
-0.026253 -0.066593 0.000000 0.000000 0.000000 1.000000 0.069767 0.000000
0.049759 -0.071331 0.000000 0.000000 0.000000 1.000000 0.940199 0.000000
0.013957 -0.071079 0.000000 0.000000 0.000000 1.000000 0.863787 0.000000
-0.066786 -0.072867 0.000000 0.000000 0.000000 1.000000 0.764120 0.000000
-0.124657 -0.083169 0.000000 0.000000 0.000000 1.000000 0.322259 0.000000
0.010077 -0.074865 0.000000 0.000000 0.000000 1.000000 0.860465 0.000000
0.045998 -0.075941 0.000000 0.000000 0.000000 1.000000 0.943522 0.000000
-0.098115 -0.081506 0.000000 0.000000 0.000000 1.000000 0.531561 0.000000
0.070708 -0.081552 0.000000 0.000000 0.000000 1.000000 0.395349 0.000000
-0.061736 -0.076988 0.000000 0.000000 0.000000 1.000000 0.767442 0.000000
0.006162 -0.078113 0.000000 0.000000 0.000000 1.000000 0.857143 0.000000
0.042383 -0.080367 0.000000 0.000000 0.000000 1.000000 0.946844 0.000000
-0.056350 -0.080583 0.000000 0.000000 0.000000 1.000000 0.770764 0.000000
0.002241 -0.080860 0.000000 0.000000 0.000000 1.000000 0.853821 0.000000
0.038944 -0.084567 0.000000 0.000000 0.000000 1.000000 0.468439 0.000000
-0.050683 -0.083613 0.000000 0.000000 0.000000 1.000000 0.774086 0.000000
-0.001662 -0.083143 0.000000 0.000000 0.000000 1.000000 0.850498 0.000000
-0.090090 -0.090538 0.000000 0.000000 0.000000 1.000000 0.528239 0.000000
0.063208 -0.090746 0.000000 0.000000 0.000000 1.000000 0.392027 0.000000
-0.005519 -0.084999 0.000000 0.000000 0.000000 1.000000 0.847176 0.000000
-0.116148 -0.095452 0.000000 0.000000 0.000000 1.000000 0.325581 0.000000
-0.044788 -0.086038 0.000000 0.000000 0.000000 1.000000 0.777409 0.000000
0.034252 -0.089953 0.000000 0.000000 0.000000 1.000000 0.471761 0.000000
-0.009305 -0.086467 0.000000 0.000000 0.000000 1.000000 0.843854 0.000000
-0.038718 -0.087820 0.000000 0.000000 0.000000 1.000000 0.780731 0.000000
-0.012994 -0.087584 0.000000 0.000000 0.000000 1.000000 0.840532 0.000000
-0.016560 -0.088388 0.000000 0.000000 0.000000 1.000000 0.837209 0.000000
-0.032526 -0.088917 0.000000 0.000000 0.000000 1.000000 0.784053 0.000000
-0.019976 -0.088915 0.000000 0.000000 0.000000 1.000000 0.833887 0.000000
-0.023215 -0.089204 0.000000 0.000000 0.000000 1.000000 0.830565 0.000000
-0.026267 -0.089292 0.000000 0.000000 0.000000 1.000000 0.787375 0.000000
-0.026253 -0.089292 0.000000 0.000000 0.000000 1.000000 0.827243 0.000000
-0.026267 -0.089292 0.000000 -0.282209 -0.959353 0.000000 0.790698 0.000000
-0.026266 -0.089292 0.000000 -0.282202 -0.959355 0.000000 0.794020 0.000000
-0.026265 -0.089292 0.000000 -0.282190 -0.959358 0.000000 0.797342 0.000000
-0.026263 -0.089292 0.000000 -0.282177 -0.959362 0.000000 0.800664 0.000000
-0.026262 -0.089292 0.000000 -0.282161 -0.959367 0.000000 0.803987 0.000000
-0.026260 -0.089292 0.000000 -0.282144 -0.959372 0.000000 0.807309 0.000000
-0.026258 -0.089292 0.000000 -0.282128 -0.959377 0.000000 0.810631 0.000000
-0.026257 -0.089292 0.000000 -0.282112 -0.959382 0.000000 0.813953 0.000000
-0.026255 -0.089292 0.000000 -0.282098 -0.959386 0.000000 0.817276 0.000000
-0.026254 -0.089292 0.000000 -0.282087 -0.959389 0.000000 0.820598 0.000000
-0.026254 -0.089292 0.000000 -0.282080 -0.959391 0.000000 0.823920 0.000000
0.029396 -0.094895 0.000000 0.000000 0.000000 1.000000 0.475083 0.000000
-0.081080 -0.098583 0.000000 0.000000 0.000000 1.000000 0.524917 0.000000
0.056486 -0.098960 0.000000 0.000000 0.000000 1.000000 0.388704 0.000000
0.024384 -0.099388 0.000000 0.000000 0.000000 1.000000 0.478405 0.000000
-0.106217 -0.106653 0.000000 0.000000 0.000000 1.000000 0.328904 0.000000
-0.071231 -0.105494 0.000000 0.000000 0.000000 1.000000 0.521595 0.000000
0.049204 -0.107192 0.000000 0.000000 0.000000 1.000000 0.385382 0.000000
0.019224 -0.103427 0.000000 0.000000 0.000000 1.000000 0.481728 0.000000
0.013925 -0.107009 0.000000 0.000000 0.000000 1.000000 0.485050 0.000000
-0.060690 -0.111125 0.000000 0.000000 0.000000 1.000000 0.518272 0.000000
-0.095037 -0.116602 0.000000 0.000000 0.000000 1.000000 0.332226 0.000000
0.008495 -0.110127 0.000000 0.000000 0.000000 1.000000 0.488372 0.000000
0.041835 -0.114337 0.000000 0.000000 0.000000 1.000000 0.382060 0.000000
0.002942 -0.112779 0.000000 0.000000 0.000000 1.000000 0.491694 0.000000
-0.049603 -0.115329 0.000000 0.000000 0.000000 1.000000 0.514950 0.000000
-0.002725 -0.114959 0.000000 0.000000 0.000000 1.000000 0.495017 0.000000
0.034424 -0.120465 0.000000 0.000000 0.000000 1.000000 0.378738 0.000000
-0.008499 -0.116662 0.000000 0.000000 0.000000 1.000000 0.498339 0.000000
-0.038116 -0.117958 0.000000 0.000000 0.000000 1.000000 0.511628 0.000000
-0.082777 -0.125127 0.000000 0.000000 0.000000 1.000000 0.335548 0.000000
-0.014371 -0.117884 0.000000 0.000000 0.000000 1.000000 0.501661 0.000000
-0.020333 -0.118621 0.000000 0.000000 0.000000 1.000000 0.504983 0.000000
-0.026376 -0.118867 0.000000 0.000000 0.000000 1.000000 0.508306 0.000000
0.027019 -0.125647 0.000000 0.000000 0.000000 1.000000 0.375415 0.000000
-0.069610 -0.132056 0.000000 0.000000 0.000000 1.000000 0.338870 0.000000
0.019667 -0.129953 0.000000 0.000000 0.000000 1.000000 0.372093 0.000000
0.012414 -0.133456 0.000000 0.000000 0.000000 1.000000 0.368771 0.000000
-0.055707 -0.137218 0.000000 0.000000 0.000000 1.000000 0.342193 0.000000
0.005309 -0.136225 0.000000 0.000000 0.000000 1.000000 0.365449 0.000000
-0.001603 -0.138332 0.000000 0.000000 0.000000 1.000000 0.362126 0.000000
-0.041238 -0.140441 0.000000 0.000000 0.000000 1.000000 0.345515 0.000000
-0.008275 -0.139848 0.000000 0.000000 0.000000 1.000000 0.358804 0.000000
-0.014659 -0.140842 0.000000 0.000000 0.000000 1.000000 0.355482 0.000000
-0.026376 -0.141553 0.000000 0.000000 0.000000 1.000000 0.348837 0.000000
-0.020708 -0.141387 0.000000 0.000000 0.000000 1.000000 0.352159 0.000000
0.019726 0.150280 0.000000 0.000000 0.000000 1.000000 0.990033 0.000000
0.041545 0.181857 0.000000 0.000000 0.000000 1.000000 0.996678 0.000000
0.029737 0.185248 0.000000 0.000000 0.000000 1.000000 1.000000 0.000000
0.031548 0.146890 0.000000 0.000000 0.000000 1.000000 0.993355 0.000000
0.038576 0.141130 0.000000 0.000000 0.000000 1.000000 0.980066 0.000000
0.074572 0.154474 0.000000 0.000000 0.000000 1.000000 0.986711 0.000000
0.066837 0.164033 0.000000 0.000000 0.000000 1.000000 0.983389 0.000000
0.046325 0.131585 0.000000 0.000000 0.000000 1.000000 0.976744 0.000000
0.131679 0.046303 0.000000 0.000000 0.000000 1.000000 0.003322 0.000000
0.164026 0.067001 0.000000 0.000000 0.000000 1.000000 0.009967 0.000000
0.154438 0.074680 0.000000 0.000000 0.000000 1.000000 0.006645 0.000000
0.141268 0.038623 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000
0.147083 0.031624 0.000000 0.000000 0.000000 1.000000 0.019934 0.000000
0.185817 0.030031 0.000000 0.000000 0.000000 1.000000 0.013289 0.000000
0.181990 0.041823 0.000000 0.000000 0.000000 1.000000 0.016611 0.000000
0.150529 0.019832 0.000000 0.000000 0.000000 1.000000 0.023256 0.000000
3 0 1 2
3 3 1 0
3 3 4 1
3 5 4 3
3 5 6 4
3 7 8 9
3 10 8 7
3 11 6 5
3 11 12 6
3 13 12 11
3 13 14 12
3 15 14 13
3 15 16 14
3 17 16 15
3 17 18 16
3 17 19 18
3 20 19 17
3 20 21 19
3 22 23 24
3 22 25 23
3 26 27 20
3 27 21 20
3 26 28 27
3 29 21 27
3 30 21 29
3 31 21 30
3 31 32 21
3 33 32 31
3 26 34 28
3 35 32 33
3 36 34 26
3 35 37 32
3 36 38 34
3 39 37 35
3 39 40 37
3 39 41 40
3 42 41 39
3 36 43 38
3 42 44 41
3 45 44 42
3 45 46 44
3 47 43 36
3 47 48 43
3 49 46 45
3 49 50 46
3 51 50 49
3 47 52 48
3 53 50 51
3 54 50 53
3 54 55 50
3 56 55 54
3 57 52 47
3 57 58 52
3 59 55 56
3 59 60 55
3 57 61 58
3 62 60 59
3 63 61 57
3 64 60 62
3 63 65 61
3 64 66 60
3 67 66 64
3 63 68 65
3 69 68 63
3 70 66 67
3 69 71 68
3 70 72 66
3 73 72 70
3 69 74 71
3 75 74 69
3 76 77 78
3 79 72 73
3 75 80 74
3 76 81 77
3 79 82 72
3 76 83 81
3 84 82 79
3 85 80 75
3 85 86 80
3 76 87 83
3 88 82 84
3 85 89 86
3 88 90 82
3 76 91 87
3 92 89 85
3 93 90 88
3 92 94 89
3 76 95 91
3 96 90 93
3 97 94 92
3 97 98 94
3 96 99 90
3 100 99 96
3 76 101 95
3 101 102 95
3 97 103 98
3 104 99 100
3 105 103 97
3 101 106 102
3 104 107 99
3 108 107 104
3 105 109 103
3 101 110 106
3 111 109 105
3 112 107 108
3 111 113 109
3 101 114 110
3 112 115 107
3 116 115 112
3 117 113 111
3 117 118 113
3 101 119 114
3 116 120 115
3 101 121 119
3 122 120 116
3 101 123 121
3 122 124 120
3 101 125 123
3 126 118 117
3 126 127 118
3 76 128 101
3 129 125 101
3 122 130 124
3 129 131 125
3 76 132 128
3 133 130 122
3 133 134 130
3 76 135 132
3 126 136 127
3 137 136 126
3 129 138 131
3 139 134 133
3 139 140 134
3 76 141 135
3 137 142 136
3 143 142 137
3 139 144 140
3 145 144 139
3 129 146 138
3 145 147 144
3 76 148 141
3 149 142 143
3 149 150 142
3 145 151 147
3 152 146 129
3 153 151 145
3 153 154 151
3 76 155 148
3 152 156 146
3 157 156 152
3 153 158 154
3 159 158 153
3 159 160 158
3 161 156 157
3 159 162 160
3 149 163 150
3 76 164 155
3 165 162 159
3 161 166 156
3 167 163 149
3 168 166 161
3 165 169 162
3 76 170 164
3 171 169 165
3 171 172 169
3 173 166 168
3 171 174 172
3 167 175 163
3 173 176 166
3 177 176 173
3 178 174 171
3 76 179 170
3 180 179 76
3 178 181 174
3 182 179 180
3 178 183 181
3 184 175 167
3 185 179 182
3 186 176 177
3 187 183 178
3 185 188 179
3 187 189 183
3 190 188 185
3 191 188 190
3 187 192 189
3 184 193 175
3 186 194 176
3 195 194 186
3 196 188 191
3 196 197 188
3 187 198 192
3 199 197 196
3 200 198 187
3 201 197 199
3 200 202 198
3 203 197 201
3 203 204 197
3 200 205 202
3 206 204 203
3 207 204 206
3 200 208 205
3 208 204 207
3 209 194 195
3 200 204 208
3 200 210 204
3 211 210 200
3 212 193 184
3 211 213 210
3 214 194 209
3 212 215 193
3 214 216 194
3 217 213 211
3 217 218 213
3 219 216 214
3 220 218 217
3 220 221 218
3 222 216 219
3 223 221 220
3 223 224 221
3 212 225 215
3 222 226 216
3 223 227 224
3 228 225 212
3 229 227 223
3 230 226 222
3 229 231 227
3 232 231 229
3 232 233 231
3 232 234 233
3 235 234 232
3 235 236 234
3 235 237 236
3 238 237 235
3 238 239 237
3 240 239 238
3 241 239 240
3 242 239 241
3 243 239 242
3 244 239 243
3 245 239 244
3 246 239 245
3 247 239 246
3 248 239 247
3 249 239 248
3 250 239 249
3 251 226 230
3 228 252 225
3 251 253 226
3 254 253 251
3 255 252 228
3 255 256 252
3 254 257 253
3 258 257 254
3 259 257 258
3 255 260 256
3 261 260 255
3 262 257 259
3 262 263 257
3 264 263 262
3 261 265 260
3 266 263 264
3 266 267 263
3 268 267 266
3 261 269 265
3 270 269 261
3 271 267 268
3 272 267 271
3 270 273 269
3 273 267 272
3 270 267 273
3 270 274 267
3 275 274 270
3 275 276 274
3 275 277 276
3 278 277 275
3 278 279 277
3 278 280 279
3 281 280 278
3 281 282 280
3 281 283 282
3 284 283 281
3 284 285 283
3 286 287 288
3 286 289 287
3 290 291 292
3 290 293 291
3 294 295 296
3 294 297 295
3 298 299 300
3 301 299 298

View File

@@ -9,13 +9,40 @@ out vec2 vertexUV;
uniform mat4 modelview;
uniform mat4 projection;
uniform mat4 iNodes;
void main()
{
vec4 pos = modelview * vec4(position, 1.0);
// BARYCENTRIC COORDINATES
// compute the barycentric coordinates in a square {P0 P1 P2 P3} for the given vertex
vec4 coef = abs (vec4( 1.0 - position.x - position.y + position.y * position.x,
1.0 - position.x + position.y - position.y * position.x,
1.0 + position.x - position.y - position.y * position.x,
1.0 + position.x + position.y + position.y * position.x));
vec4 corners = coef / (coef[0] + coef[1] + coef[2] + coef[3]);
// delinearizing coordinates with attractor parameter z
coef[0] = pow( coef[0], 1.0 + iNodes[0].z);
coef[1] = pow( coef[1], 1.0 + iNodes[1].z);
coef[2] = pow( coef[2], 1.0 + iNodes[2].z);
coef[3] = pow( coef[3], 1.0 + iNodes[3].z);
// calculate coordinates of point in distorted square {A0 A1 A2 A3}
vec2 P= coef[0] * vec2(iNodes[0].x - 1.0, iNodes[0].y - 1.0) +
coef[1] * vec2(iNodes[1].x - 1.0, iNodes[1].y + 1.0) +
coef[2] * vec2(iNodes[2].x + 1.0, iNodes[2].y - 1.0) +
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));
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);
// output
gl_Position = projection * pos;
gl_Position = projection * ( modelview * vec4(pos, 1.0) );
vertexColor = color;
vertexUV = texCoord;
}

View File

@@ -212,11 +212,17 @@ Handles::Handles(Type type) : Node(), type_(type)
static Mesh *handle_corner = new Mesh("mesh/border_handles_overlay.ply");
static Mesh *handle_scale = new Mesh("mesh/border_handles_scale.ply");
static Mesh *handle_crop = new Mesh("mesh/border_handles_crop.ply");
static Mesh *handle_shape = new Mesh("mesh/border_handles_shape.ply");
static Mesh *handle_menu = new Mesh("mesh/border_handles_menu.ply");
static Mesh *handle_lock = new Mesh("mesh/border_handles_lock.ply");
static Mesh *handle_unlock = new Mesh("mesh/border_handles_lock_open.ply");
static Mesh *handle_eyeslash = new Mesh("mesh/icon_eye_slash.ply");
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");
color = glm::vec4( 1.f, 1.f, 1.f, 1.f);
corner_ = glm::vec2(0.f, 0.f);
shadow_ = handle_shadow;
if ( type_ == Handles::ROTATE ) {
handle_ = handle_rotation;
@@ -227,9 +233,12 @@ Handles::Handles(Type type) : Node(), type_(type)
else if ( type_ == Handles::MENU ) {
handle_ = handle_menu;
}
else if ( type_ == Handles::CROP ) {
else if ( type_ == Handles::EDIT_CROP ) {
handle_ = handle_crop;
}
else if ( type_ == Handles::EDIT_SHAPE ) {
handle_ = handle_shape;
}
else if ( type_ == Handles::LOCKED ) {
handle_ = handle_lock;
}
@@ -239,13 +248,13 @@ Handles::Handles(Type type) : Node(), type_(type)
else if ( type_ == Handles::EYESLASHED ) {
handle_ = handle_eyeslash;
}
else if ( type_ >= Handles::NODE_LOWER_LEFT && type_ <= Handles::NODE_UPPER_RIGHT ) {
handle_ = handle_node;
}
else {
handle_ = handle_corner;
}
color = glm::vec4( 1.f, 1.f, 1.f, 1.f);
corner_ = glm::vec2(0.f, 0.f);
shadow_ = handle_shadow;
}
Handles::~Handles()
@@ -365,13 +374,13 @@ void Handles::draw(glm::mat4 modelview, glm::mat4 projection)
shadow_->draw( ctm, projection );
handle_->draw( ctm, projection );
}
else if ( type_ == Handles::CROP ){
// one icon in bottom right corner
else if ( type_ == Handles::EDIT_CROP || type_ == Handles::EDIT_SHAPE ){
// one icon in bottom left corner
// 1. Fixed displacement by (0.12,0.12) along the rotation..
ctm = GlmToolkit::transform(glm::vec4(0.f), rot, mirror);
glm::vec4 pos = ctm * glm::vec4(mirror.x * 0.12f, mirror.x * 0.12f, 0.f, 1.f);
glm::vec4 pos = ctm * glm::vec4(mirror.x * -0.13f, mirror.x * -0.12f, 0.f, 1.f);
// 2. ..from the bottom left corner (-1,-1)
vec = ( modelview * glm::vec4(-1.f, -1.f, 0.f, 1.f) ) + pos;
vec = ( modelview * glm::vec4(-1.f, 1.f, 0.f, 1.f) ) + pos;
ctm = GlmToolkit::transform(vec, rot, mirror);
// 3. draw
shadow_->draw( ctm, projection );
@@ -390,7 +399,7 @@ void Handles::draw(glm::mat4 modelview, glm::mat4 projection)
handle_->draw( ctm, projection );
}
else if ( type_ == Handles::LOCKED || type_ == Handles::UNLOCKED ){
// one icon in top left corner
// one icon in bottom right corner
// 1. Fixed displacement by (-0.12,0.12) along the rotation..
ctm = GlmToolkit::transform(glm::vec4(0.f), rot, mirror);
glm::vec4 pos = ctm * glm::vec4( -0.12f, 0.12f, 0.f, 1.f);
@@ -413,6 +422,34 @@ void Handles::draw(glm::mat4 modelview, glm::mat4 projection)
shadow_->draw( ctm, projection );
handle_->draw( ctm, projection );
}
else if ( type_ == Handles::NODE_LOWER_LEFT ) {
// 1. Corner
vec = modelview * glm::vec4(translation_.x - 1.f, translation_.y - 1.f, 0.f, 1.f) ;
ctm = GlmToolkit::transform(vec, rot, glm::vec3(1.f));
// 2. draw
handle_->draw( ctm, projection );
}
else if ( type_ == Handles::NODE_UPPER_LEFT ) {
// 1. Corner
vec = modelview * glm::vec4(translation_.x - 1.f, translation_.y + 1.f, 0.f, 1.f) ;
ctm = GlmToolkit::transform(vec, rot, glm::vec3(1.f));
// 2. draw
handle_->draw( ctm, projection );
}
else if ( type_ == Handles::NODE_LOWER_RIGHT ) {
// 1. Corner
vec = modelview * glm::vec4(translation_.x + 1.f, translation_.y - 1.f, 0.f, 1.f) ;
ctm = GlmToolkit::transform(vec, rot, glm::vec3(1.f));
// 2. draw
handle_->draw( ctm, projection );
}
else if ( type_ == Handles::NODE_UPPER_RIGHT ){
// 1. Corner
vec = modelview * glm::vec4(translation_.x + 1.f, translation_.y + 1.f, 0.f, 1.f) ;
ctm = GlmToolkit::transform(vec, rot, glm::vec3(1.f));
// 2. draw
handle_->draw( ctm, projection );
}
}
}
@@ -488,15 +525,16 @@ Symbol::Symbol(Type t, glm::vec3 pos) : Node(), type_(t)
shadows[CLOCK_H]= nullptr;
icons[SQUARE] = new Mesh("mesh/icon_square.ply");
shadows[SQUARE] = nullptr;
icons[CROSS] = new Mesh("mesh/icon_cross.ply");
shadows[CROSS] = nullptr;
icons[GRID] = new Mesh("mesh/icon_grid.ply");
shadows[GRID] = nullptr;
icons[CROSS] = new Mesh("mesh/icon_cross.ply");
shadows[CROSS] = nullptr;
icons[MAGNET] = new Mesh("mesh/icon_magnet.ply");
shadows[MAGNET] = nullptr;
icons[EMPTY] = new Mesh("mesh/icon_empty.ply");
shadows[EMPTY] = shadow;
}
symbol_ = icons[type_];
shadow_ = shadows[type_];
translation_ = pos;

View File

@@ -36,7 +36,23 @@ protected:
class Handles : public Node
{
public:
typedef enum { RESIZE = 0, RESIZE_H, RESIZE_V, ROTATE, SCALE, CROP, MENU, LOCKED, UNLOCKED, EYESLASHED } Type;
typedef enum {
RESIZE = 0,
RESIZE_H,
RESIZE_V,
ROTATE,
SCALE,
NODE_LOWER_LEFT,
NODE_UPPER_LEFT,
NODE_LOWER_RIGHT,
NODE_UPPER_RIGHT,
EDIT_CROP,
EDIT_SHAPE,
MENU,
LOCKED,
UNLOCKED,
EYESLASHED
} Type;
Handles(Type type);
~Handles();
@@ -60,8 +76,42 @@ protected:
class Symbol : public Node
{
public:
typedef enum { CIRCLE_POINT = 0, SQUARE_POINT, IMAGE, SEQUENCE, VIDEO, SESSION, CLONE, RENDER, GROUP, PATTERN, GEAR, CAMERA, SCREEN, SHARE, RECEIVE, TEXT,
DOTS, BUSY, LOCK, UNLOCK, EYE, EYESLASH, TELEVISION, ARROWS, ROTATION, CROP, CIRCLE, SQUARE, CLOCK, CLOCK_H, GRID, CROSS, EMPTY } Type;
typedef enum {
CIRCLE_POINT = 0,
SQUARE_POINT,
IMAGE,
SEQUENCE,
VIDEO,
SESSION,
CLONE,
RENDER,
GROUP,
PATTERN,
GEAR,
CAMERA,
SCREEN,
SHARE,
RECEIVE,
TEXT,
DOTS,
BUSY,
LOCK,
UNLOCK,
EYE,
EYESLASH,
TELEVISION,
ARROWS,
ROTATION,
CROP,
CIRCLE,
SQUARE,
CLOCK,
CLOCK_H,
GRID,
CROSS,
MAGNET,
EMPTY
} Type;
Symbol(Type t, glm::vec3 pos = glm::vec3(0.f));
~Symbol();

View File

@@ -39,7 +39,7 @@ FrameBuffer::FrameBuffer(glm::vec3 resolution, FrameBufferFlags flags): flags_(f
textureid_(0), multisampling_textureid_(0), framebufferid_(0), multisampling_framebufferid_(0), mem_usage_(0)
{
attrib_.viewport = glm::ivec2(resolution);
setProjectionArea(glm::vec2(1.f, 1.f));
setProjectionArea(glm::vec4(-1.f, 1.f, 1.f, -1.f));
attrib_.clear_color = glm::vec4(0.f, 0.f, 0.f, 0.f);
}
@@ -47,7 +47,7 @@ FrameBuffer::FrameBuffer(uint width, uint height, FrameBufferFlags flags): flags
textureid_(0), multisampling_textureid_(0), framebufferid_(0), multisampling_framebufferid_(0), mem_usage_(0)
{
attrib_.viewport = glm::ivec2(width, height);
setProjectionArea(glm::vec2(1.f, 1.f));
setProjectionArea(glm::vec4(-1.f, 1.f, 1.f, -1.f));
attrib_.clear_color = glm::vec4(0.f, 0.f, 0.f, 0.f);
}
@@ -390,18 +390,29 @@ glm::mat4 FrameBuffer::projection() const
return projection_;
}
glm::vec2 FrameBuffer::projectionArea() const
glm::vec4 FrameBuffer::projectionArea() const
{
return projection_area_;
}
void FrameBuffer::setProjectionArea(glm::vec2 c)
glm::vec2 FrameBuffer::projectionSize() const
{
projection_area_.x = CLAMP(c.x, 0.1f, 1.f);
projection_area_.y = CLAMP(c.y, 0.1f, 1.f);
projection_ = glm::ortho(-projection_area_.x, projection_area_.x, projection_area_.y, -projection_area_.y, -1.f, 1.f);
glm::vec2 size;
size.x = (projection_area_[1] - projection_area_[0]) * 0.5f;
size.y = (projection_area_[2] - projection_area_[3]) * 0.5f;
return size;
}
void FrameBuffer::setProjectionArea(glm::vec4 c)
{
projection_area_ = glm::clamp(c, glm::vec4(-1.f, 0.1f, 0.1f, -1.f), glm::vec4(-0.1f, 1.f, 1.f, -0.1f));
projection_ = glm::ortho(projection_area_[0],
projection_area_[1],
projection_area_[2],
projection_area_[3],
-1.f,
1.f);
}
FrameBufferImage::FrameBufferImage(int w, int h) :
rgb(nullptr), width(w), height(h), is_stbi(false)

View File

@@ -80,8 +80,9 @@ public:
// projection area (crop)
glm::mat4 projection() const;
glm::vec2 projectionArea() const;
void setProjectionArea(glm::vec2 c);
glm::vec2 projectionSize() const;
glm::vec4 projectionArea() const;
void setProjectionArea(glm::vec4 c);
// internal pixel format
inline uint opengl_id() const { return framebufferid_; }
@@ -102,7 +103,7 @@ private:
FrameBufferFlags flags_;
RenderingAttrib attrib_;
glm::mat4 projection_;
glm::vec2 projection_area_;
glm::vec4 projection_area_;
uint textureid_, multisampling_textureid_;
uint framebufferid_, multisampling_framebufferid_;
uint mem_usage_;

View File

@@ -331,34 +331,40 @@ void GeometryView::draw()
}
if (ImGui::BeginPopup("GeometrySourceContextMenu")) {
if (s != nullptr) {
if (ImGui::Selectable( ICON_FA_EXPAND " Fit" )){
if (ImGui::MenuItem( ICON_FA_EXPAND " Fit" )){
s->group(mode_)->scale_ = glm::vec3(output_surface_->scale_.x/ s->frame()->aspectRatio(), 1.f, 1.f);
s->group(mode_)->rotation_.z = 0;
s->group(mode_)->translation_ = glm::vec3(0.f);
s->touch();
Action::manager().store(s->name() + std::string(": Geometry Fit"));
}
if (ImGui::Selectable( ICON_FA_VECTOR_SQUARE " Reset" )){
if (ImGui::MenuItem( ICON_FA_VECTOR_SQUARE " Reset shape" )){
s->group(mode_)->scale_ = glm::vec3(1.f);
s->group(mode_)->rotation_.z = 0;
s->group(mode_)->crop_ = glm::vec3(1.f);
s->group(mode_)->translation_ = glm::vec3(0.f);
s->touch();
Action::manager().store(s->name() + std::string(": Geometry Reset"));
}
if (ImGui::Selectable( ICON_FA_CROSSHAIRS " Reset position" )){
if (ImGui::MenuItem( ICON_FA_CROP_ALT " Reset crop" )){
s->group(mode_)->crop_ = glm::vec4(-1.f, 1.f, 1.f, -1.f);
s->group(mode_)->data_ = glm::zero<glm::mat4>();
s->touch();
Action::manager().store(s->name() + std::string(": Crop Reset"));
}
if (ImGui::MenuItem( ICON_FA_CROSSHAIRS " Reset position" )){
s->group(mode_)->translation_ = glm::vec3(0.f);
s->touch();
Action::manager().store(s->name() + std::string(": Reset position"));
}
if (ImGui::Selectable( ICON_FA_COMPASS " Reset rotation" )){
if (ImGui::MenuItem( ICON_FA_COMPASS " Reset rotation" )){
s->group(mode_)->rotation_.z = 0;
s->touch();
Action::manager().store(s->name() + std::string(": Reset rotation"));
}
if (ImGui::Selectable( ICON_FA_EXPAND_ALT " Reset aspect ratio" )){
if (ImGui::MenuItem( ICON_FA_EXPAND_ALT " Reset aspect ratio" )){
s->group(mode_)->scale_.x = s->group(mode_)->scale_.y;
s->group(mode_)->scale_.x *= s->group(mode_)->crop_.x / s->group(mode_)->crop_.y;
s->group(mode_)->scale_.x *= (s->group(mode_)->crop_[1] - s->group(mode_)->crop_[0]) /
(s->group(mode_)->crop_[2] - s->group(mode_)->crop_[3]);
s->touch();
Action::manager().store(s->name() + std::string(": Reset aspect ratio"));
}
@@ -391,7 +397,7 @@ void GeometryView::draw()
for (auto sit = Mixer::selection().begin(); sit != Mixer::selection().end(); ++sit){
(*sit)->group(mode_)->scale_ = glm::vec3(1.f);
(*sit)->group(mode_)->rotation_.z = 0;
(*sit)->group(mode_)->crop_ = glm::vec3(1.f);
(*sit)->group(mode_)->crop_ = glm::vec4(-1.f, 1.f, 1.f, -1.f);
(*sit)->group(mode_)->translation_ = glm::vec3(0.f);
(*sit)->touch();
}
@@ -481,7 +487,10 @@ void GeometryView::adaptGridToSource(Source *s, Node *picked)
grid = translation_grid_;
}
else if ( picked == s->handles_[mode_][Handles::SCALE] ||
picked == s->handles_[mode_][Handles::CROP] ){
picked == s->handles_[mode_][Handles::NODE_LOWER_LEFT] ||
picked == s->handles_[mode_][Handles::NODE_UPPER_LEFT] ||
picked == s->handles_[mode_][Handles::NODE_LOWER_RIGHT] ||
picked == s->handles_[mode_][Handles::NODE_UPPER_RIGHT] ){
translation_grid_->root()->translation_ = s->group(mode_)->translation_;
translation_grid_->root()->rotation_.z = s->group(mode_)->rotation_.z;
// Swap grid to translation grid
@@ -544,6 +553,16 @@ std::pair<Node *, glm::vec2> GeometryView::pick(glm::vec2 P)
else if ( pick.first == current->handles_[mode_][Handles::MENU] ) {
openContextMenu(MENU_SOURCE);
}
// picking on the crop handle : switch to shape manipulation mode
else if (pick.first == current->handles_[mode_][Handles::EDIT_CROP]) {
current->manipulator_->setActive(0);
pick = { current->handles_[mode_][Handles::EDIT_SHAPE], glm::vec2(0.f) };
}
// picking on the shape handle : switch to crop manipulation mode
else if (pick.first == current->handles_[mode_][Handles::EDIT_SHAPE]) {
current->manipulator_->setActive(1);
pick = { current->handles_[mode_][Handles::EDIT_CROP], glm::vec2(0.f) };
}
// pick on the lock icon; unlock source
else if ( UserInterface::manager().ctrlModifier() && pick.first == current->lock_ ) {
lock(current, false);
@@ -818,15 +837,103 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
const glm::mat4 scene_to_corner_transform = source_to_corner_transform * scene_to_source_transform;
const glm::mat4 corner_to_scene_transform = glm::inverse(scene_to_corner_transform);
// picking on the resizing handles in the corners RESIZE CORNER
if ( pick.first == s->handles_[mode_][Handles::RESIZE] ) {
// picking on a Node
if (pick.first == s->handles_[mode_][Handles::NODE_LOWER_LEFT]) {
// hide other grips
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].x,
s->stored_status_->data_[0].y,
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);
// snap handle coordinates to grid (if active)
if ( grid->active() )
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);
// hide all other grips
// 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::MENU]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
// get stored status
glm::vec3 node_pos = glm::vec3(s->stored_status_->data_[1].x,
s->stored_status_->data_[1].y,
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);
// snap handle coordinates to grid (if active)
if ( grid->active() )
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);
// 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::MENU]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
// get stored status
glm::vec3 node_pos = glm::vec3(s->stored_status_->data_[2].x,
s->stored_status_->data_[2].y,
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);
// snap handle coordinates to grid (if active)
if ( grid->active() )
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);
// 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::MENU]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
// get stored status
glm::vec3 node_pos = glm::vec3(s->stored_status_->data_[3].x,
s->stored_status_->data_[3].y,
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);
// snap handle coordinates to grid (if active)
if ( grid->active() )
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);
// 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 );
}
// picking on the resizing handles in the corners RESIZE CORNER
else if ( pick.first == s->handles_[mode_][Handles::RESIZE] ) {
// hide other grips
s->handles_[mode_][Handles::SCALE]->visible_ = false;
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::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]->overlayActiveCorner(-corner);
@@ -840,7 +947,7 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
// snap handle coordinates to grid (if active)
if ( grid->active() )
handle = grid->snap(handle);
// Compute coordinates coordinates back in CORNER reference frame
// Compute handleNODE_UPPER_RIGHT coordinates back in CORNER reference frame
handle = scene_to_corner_transform * handle;
// The scaling factor is computed by dividing new handle coordinates with the ones before transform
glm::vec2 corner_scaling = glm::vec2(handle) / glm::vec2(corner * 2.f);
@@ -881,7 +988,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::CROP]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->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);
@@ -935,7 +1042,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::CROP]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->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);
@@ -989,7 +1096,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::CROP]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
// prepare overlay
overlay_scaling_cross_->visible_ = false;
@@ -1031,61 +1138,60 @@ View::Cursor GeometryView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::p
info << "Size " << std::fixed << std::setprecision(3) << sourceNode->scale_.x;
info << " x " << sourceNode->scale_.y;
}
// picking on the CROP
else if ( pick.first == s->handles_[mode_][Handles::CROP] ) {
// // picking on the CROP
// else if ( pick.first == s->handles_[mode_][Handles::EDIT_SHAPE] ) {
// hide all other grips
s->handles_[mode_][Handles::RESIZE]->visible_ = false;
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::SCALE]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
// prepare overlay
overlay_crop_->scale_ = s->stored_status_->scale_ / s->stored_status_->crop_;
overlay_crop_->scale_.x *= s->frame()->aspectRatio();
overlay_crop_->translation_.x = s->stored_status_->translation_.x;
overlay_crop_->translation_.y = s->stored_status_->translation_.y;
overlay_crop_->rotation_.z = s->stored_status_->rotation_.z;
overlay_crop_->update(0);
overlay_crop_->visible_ = true;
// // hide all other grips
// s->handles_[mode_][Handles::RESIZE]->visible_ = false;
// 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::SCALE]->visible_ = false;
// s->handles_[mode_][Handles::MENU]->visible_ = false;
// // prepare overlay
// overlay_crop_->scale_ = s->stored_status_->scale_ / s->stored_status_->crop_;
// overlay_crop_->scale_.x *= s->frame()->aspectRatio();
// overlay_crop_->translation_.x = s->stored_status_->translation_.x;
// overlay_crop_->translation_.y = s->stored_status_->translation_.y;
// overlay_crop_->rotation_.z = s->stored_status_->rotation_.z;
// overlay_crop_->update(0);
// overlay_crop_->visible_ = true;
//
// Manipulate the scaling handle in the SCENE coordinates to apply grid snap
//
glm::vec3 handle = glm::vec3( glm::round(pick.second), 0.f);
// Compute handle coordinates into SCENE reference frame
handle = source_to_scene_transform * glm::vec4( handle, 1.f );
// move the handle we hold by the mouse translation (in scene reference frame)
handle = glm::translate(glm::identity<glm::mat4>(), scene_to - scene_from) * glm::vec4( handle, 1.f );
// snap handle coordinates to grid (if active)
if ( grid->active() )
handle = grid->snap(handle);
// Compute handle coordinates back in SOURCE reference frame
handle = scene_to_source_transform * glm::vec4( handle, 1.f );
// The scaling factor is computed by dividing new handle coordinates with the ones before transform
glm::vec2 handle_scaling = glm::vec2(handle)/ glm::round(pick.second);
// //
// // Manipulate the scaling handle in the SCENE coordinates to apply grid snap
// //
// glm::vec3 handle = glm::vec3( glm::round(pick.second), 0.f);
// // Compute handle coordinates into SCENE reference frame
// handle = source_to_scene_transform * glm::vec4( handle, 1.f );
// // move the handle we hold by the mouse translation (in scene reference frame)
// handle = glm::translate(glm::identity<glm::mat4>(), scene_to - scene_from) * glm::vec4( handle, 1.f );
// // snap handle coordinates to grid (if active)
// if ( grid->active() )
// handle = grid->snap(handle);
// // Compute handle coordinates back in SOURCE reference frame
// handle = scene_to_source_transform * glm::vec4( handle, 1.f );
// // The scaling factor is computed by dividing new handle coordinates with the ones before transform
// glm::vec2 handle_scaling = glm::vec2(handle)/ glm::round(pick.second);
// proportional SCALING with SHIFT
if (UserInterface::manager().shiftModifier()) {
handle_scaling = glm::vec2(glm::compMax(handle_scaling));
}
// // proportional SCALING with SHIFT
// if (UserInterface::manager().shiftModifier()) {
// handle_scaling = glm::vec2(glm::compMax(handle_scaling));
// }
// Apply scaling to the CROP node of source
sourceNode->crop_ = s->stored_status_->crop_ * glm::vec3(handle_scaling, 1.f);
// CLAMP crop values
sourceNode->crop_.x = CLAMP(sourceNode->crop_.x, 0.1f, 1.f);
sourceNode->crop_.y = CLAMP(sourceNode->crop_.y, 0.1f, 1.f);
// // Apply scaling to the CROP node of source
// sourceNode->crop_ = s->stored_status_->crop_ * glm::vec3(handle_scaling, 1.f);
// // CLAMP crop values
// sourceNode->crop_.x = CLAMP(sourceNode->crop_.x, 0.1f, 1.f);
// sourceNode->crop_.y = CLAMP(sourceNode->crop_.y, 0.1f, 1.f);
// Apply scaling to the source
s->frame()->setProjectionArea( glm::vec2(sourceNode->crop_) );
sourceNode->scale_ = s->stored_status_->scale_ * (sourceNode->crop_ / s->stored_status_->crop_);
// show cursor depending on diagonal
corner = glm::sign(sourceNode->scale_);
ret.type = (corner.x * corner.y) < 0.f ? Cursor_ResizeNWSE : Cursor_ResizeNESW;
info << "Crop " << std::fixed << std::setprecision(3) << sourceNode->crop_.x;
info << " x " << sourceNode->crop_.y;
}
// // Apply scaling to the source
// sourceNode->scale_ = s->stored_status_->scale_ * (sourceNode->crop_ / s->stored_status_->crop_);
// // show cursor depending on diagonal
// corner = glm::sign(sourceNode->scale_);
// ret.type = (corner.x * corner.y) < 0.f ? Cursor_ResizeNWSE : Cursor_ResizeNESW;
// info << "Crop " << std::fixed << std::setprecision(3) << sourceNode->crop_.x;
// info << " x " << sourceNode->crop_.y;
// }
// picking on the rotating handle
else if ( pick.first == s->handles_[mode_][Handles::ROTATE] ) {
@@ -1094,7 +1200,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::CROP]->visible_ = false;
s->handles_[mode_][Handles::EDIT_CROP]->visible_ = false;
s->handles_[mode_][Handles::MENU]->visible_ = false;
// ROTATION on CENTER
overlay_rotation_->visible_ = true;
@@ -1256,7 +1362,8 @@ void GeometryView::terminate(bool force)
(*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::CROP]->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;
}

View File

@@ -476,10 +476,10 @@ void ImGuiVisitor::visit (Source& s)
// preview
float width = preview_width;
float height = s.frame()->projectionArea().y * width / ( s.frame()->projectionArea().x * s.frame()->aspectRatio());
float height = s.frame()->projectionSize().y * width / ( s.frame()->projectionSize().x * s.frame()->aspectRatio());
if (height > preview_height - space) {
height = preview_height - space;
width = height * s.frame()->aspectRatio() * ( s.frame()->projectionArea().x / s.frame()->projectionArea().y);
width = height * s.frame()->aspectRatio() * ( s.frame()->projectionSize().x / s.frame()->projectionSize().y);
}
// centered image
if (s.ready()) {
@@ -649,10 +649,10 @@ void ImGuiVisitor::visit (Source& s)
// preview (black texture)
float width = preview_width;
float height = s.frame()->projectionArea().y * width / ( s.frame()->projectionArea().x * s.frame()->aspectRatio());
float height = s.frame()->projectionSize().y * width / ( s.frame()->projectionSize().x * s.frame()->aspectRatio());
if (height > preview_height - space) {
height = preview_height - space;
width = height * s.frame()->aspectRatio() * ( s.frame()->projectionArea().x / s.frame()->projectionArea().y);
width = height * s.frame()->aspectRatio() * ( s.frame()->projectionSize().x / s.frame()->projectionSize().y);
}
// centered image
ImGui::SetCursorPos( ImVec2(pos.x + 0.5f * (preview_width-width), pos.y + 0.5f * (preview_height-height-space)) );

View File

@@ -19,6 +19,8 @@
#include <glad/glad.h>
#include <glm/gtc/type_ptr.hpp>
#include "defines.h"
#include "Visitor.h"
#include "Resource.h"
@@ -56,6 +58,7 @@ void ImageShader::use()
// set stippling
program_->setUniform("stipple", stipple);
program_->setUniform("iNodes", iNodes);
// default mask
if (mask_texture == 0)
@@ -76,12 +79,15 @@ void ImageShader::reset()
// no stippling
stipple = 0.f;
iNodes = glm::zero<glm::mat4>();
}
void ImageShader::copy(ImageShader const& S)
{
mask_texture = S.mask_texture;
stipple = S.stipple;
iNodes = S.iNodes;
}

View File

@@ -22,6 +22,7 @@ public:
// uniforms
float stipple;
glm::mat4 iNodes;
};
class AlphaShader : public ImageShader

View File

@@ -61,10 +61,6 @@ void InfoVisitor::visit(Node &n)
oss << "Scale ( " << n.scale_.x << ", " << n.scale_.y << " )" << std::endl;
oss << "Angle " << std::setprecision(2) << n.rotation_.z * 180.f / M_PI << "\u00B0" << std::endl;
if (!brief_) {
oss << n.crop_.x << ", " << n.crop_.y << " Crop" << std::endl;
}
information_ = oss.str();
}

View File

@@ -194,6 +194,7 @@ void MediaSource::render()
init();
else {
// render the media player into frame buffer
// NB: this also applies the color correction shader
renderbuffer_->begin();
// apply fading
texturesurface_->shader()->color = glm::vec4( glm::vec3(mediaplayer_->currentTimelineFading()), 1.f);

View File

@@ -180,10 +180,10 @@ void PickingVisitor::visit(Handles &n)
glm::vec4 pos = glm::inverse(ctm) * ( mirror * glm::vec4( 0.12f, -0.12f, 0.f, 0.f ) );
picked = glm::length( glm::vec2( 1.f, -1.f) + glm::vec2(pos) - glm::vec2(P) ) < 1.5f * scale;
}
else if ( n.type() == Handles::CROP ){
// the icon for cropping is on the left bottom corner at (0.12, 0.12) in scene coordinates
glm::vec4 pos = glm::inverse(ctm) * ( mirror * glm::vec4( 0.12f, 0.12f, 0.f, 0.f ) );
picked = glm::length( glm::vec2( -1.f, -1.f) + glm::vec2(pos) - glm::vec2(P) ) < 1.5f * scale;
else if ( n.type() == Handles::EDIT_CROP || n.type() == Handles::EDIT_SHAPE ){
// the icon for cropping is on the top bottom corner at (0.12, 0.12) in scene coordinates
glm::vec4 pos = glm::inverse(ctm) * ( mirror * glm::vec4( -0.13f, -0.12f, 0.f, 0.f ) );
picked = glm::length( glm::vec2( -1.f, 1.f) + glm::vec2(pos) - glm::vec2(P) ) < 1.5f * scale;
}
else if ( n.type() == Handles::MENU ){
// the icon for menu is on the left top corner at (-0.12, 0.12) in scene coordinates
@@ -195,6 +195,18 @@ void PickingVisitor::visit(Handles &n)
glm::vec4 pos = glm::inverse(ctm) * ( mirror * glm::vec4( -0.12f, 0.12f, 0.f, 0.f ) );
picked = glm::length( glm::vec2( 1.f, -1.f) + glm::vec2(pos) - glm::vec2(P) ) < 1.5f * scale;
}
else if ( n.type() == Handles::NODE_LOWER_LEFT ) {
picked = glm::length( glm::vec2(-1.f, -1.f) - glm::vec2(P) ) < scale;
}
else if ( n.type() == Handles::NODE_UPPER_LEFT ) {
picked = glm::length( glm::vec2(-1.f, 1.f) - glm::vec2(P) ) < scale;
}
else if ( n.type() == Handles::NODE_LOWER_RIGHT ) {
picked = glm::length( glm::vec2(1.f, -1.f) - glm::vec2(P) ) < scale;
}
else if ( n.type() == Handles::NODE_UPPER_RIGHT ){
picked = glm::length( glm::vec2(1.f, 1.f) - glm::vec2(P) ) < scale;
}
if ( picked )
// add this to the nodes picked

View File

@@ -35,6 +35,8 @@
#include "Primitives.h"
#define MESH_SURFACE_DENSITY 32
Surface::Surface(Shader *s) : Primitive(s), textureindex_(0), mirror_(true)
{
// geometry for a trianglulated simple rectangle surface with UV
@@ -116,6 +118,95 @@ void Surface::draw(glm::mat4 modelview, glm::mat4 projection)
glBindTexture(GL_TEXTURE_2D, 0);
}
MeshSurface::MeshSurface(Shader *s) : Surface(s)
{
}
void MeshSurface::generate_mesh(size_t rows, size_t columns)
{
// Set up vertices
points_.resize(rows * columns);
texCoords_.resize(rows * columns);
colors_.resize(rows * columns);
for (size_t c = 0; c < columns; ++c) {
for (size_t r = 0; r < rows; ++r) {
size_t index = c * columns + r;
points_[index] = glm::vec3(-1.f, -1.f, 0.f)
+ 2.f * glm::vec3((float) c / (float) (columns - 1),
(float) r / (float) (rows - 1),
0.f);
texCoords_[index] = glm::vec2(0.f, 1.f)
+ glm::vec2((float) c / (float) (columns - 1),
-1.f * (float) r / (float) (rows - 1));
colors_[index] = glm::vec4(1.f, 1.f, 1.f, 1.f);
}
}
// Set up indices
indices_.resize( (rows * 2 + 2) * (columns - 1) - 2 );
size_t i = 0;
size_t height = columns - 1;
for (size_t y = 0; y < height; y++) {
size_t base = y * rows;
//indices[i++] = (uint16)base;
for (size_t x = 0; x < rows; x++) {
indices_[i++] = (base + x);
indices_[i++] = (base + rows + x);
}
// add a degenerate triangle (except in a last row)
if (y < height - 1) {
indices_[i++] = ((y + 1) * rows + (rows - 1));
indices_[i++] = ((y + 1) * rows);
}
}
drawMode_ = GL_TRIANGLE_STRIP;
// g_printerr("generated_mesh %lu x %lu :\n", rows, columns);
// g_printerr("%lu points\n", points_.size());
// for(size_t ind=0; ind < points_.size(); ind++) {
// g_printerr("point[%lu] : %f, %f, %f \n", ind, points_[ind].x, points_[ind].y, points_[ind].z);
// g_printerr(" : %f, %f \n", texCoords_[ind].x, texCoords_[ind].y);
// }
// g_printerr("%lu indices\n", indices_.size());
// for(size_t ind=0; ind < indices_.size(); ind++) {
// g_printerr("index[%lu] = %u \n", ind, indices_[ind]);
// }
}
void MeshSurface::init()
{
// use static unique vertex array object
static uint unique_vao_ = 0;
static uint unique_drawCount = 0;
if (unique_vao_) {
// 1. only init Node (not the primitive vao)
Node::init();
// 2. use the global vertex array object
vao_ = unique_vao_;
drawCount_ = unique_drawCount;
// compute AxisAlignedBoundingBox
bbox_.extend(points_);
// arrays of vertices are not needed anymore
points_.clear();
colors_.clear();
texCoords_.clear();
indices_.clear();
}
else {
// 0. generate mesh
generate_mesh(MESH_SURFACE_DENSITY, MESH_SURFACE_DENSITY);
// 1. init the Primitive (only once)
Primitive::init();
// 2. remember global vertex array object
unique_vao_ = vao_;
unique_drawCount = drawCount_;
// 3. unique_vao_ will NOT be deleted
}
}
ImageSurface::ImageSurface(const std::string& path, Shader *s) : Surface(s), resource_(path)
{
@@ -159,6 +250,29 @@ void FrameBufferSurface::accept(Visitor& v)
v.visit(*this);
}
FrameBufferMeshSurface::FrameBufferMeshSurface(FrameBuffer *fb, Shader *s) : MeshSurface(s), frame_buffer_(fb)
{
}
void FrameBufferMeshSurface::draw(glm::mat4 modelview, glm::mat4 projection)
{
if ( !initialized() )
init();
glBindTexture(GL_TEXTURE_2D, frame_buffer_->texture());
Primitive::draw(modelview, projection);
glBindTexture(GL_TEXTURE_2D, 0);
}
void FrameBufferMeshSurface::accept(Visitor& v)
{
Surface::accept(v);
v.visit(*this);
}
Points::Points(std::vector<glm::vec3> points, glm::vec4 color, uint pointsize) : Primitive(new Shader)
{
for(size_t i = 0; i < points.size(); ++i)

View File

@@ -36,8 +36,21 @@ public:
protected:
uint textureindex_;
bool mirror_;
void generate_mesh(size_t w, size_t h);
};
class MeshSurface : public Surface {
public:
MeshSurface(Shader *s = new ImageShader);
void init () override;
protected:
void generate_mesh(size_t w, size_t h);
};
/**
* @brief The ImageSurface class is a Surface to draw an image
@@ -83,6 +96,22 @@ protected:
FrameBuffer *frame_buffer_;
};
class FrameBufferMeshSurface : public MeshSurface {
public:
FrameBufferMeshSurface(FrameBuffer *fb, Shader *s = new ImageShader);
void draw (glm::mat4 modelview, glm::mat4 projection) override;
void accept (Visitor& v) override;
inline void setFrameBuffer(FrameBuffer *fb) { frame_buffer_ = fb; }
inline FrameBuffer *frameBuffer() const { return frame_buffer_; }
protected:
FrameBuffer *frame_buffer_;
};
/**
* @brief The Points class is a Primitive to draw Points
*/

View File

@@ -49,7 +49,8 @@ Node::Node() : initialized_(false), visible_(true), refcount_(0)
scale_ = glm::vec3(1.f);
rotation_ = glm::vec3(0.f);
translation_ = glm::vec3(0.f);
crop_ = glm::vec3(1.f);
crop_ = glm::vec4(-1.f, 1.f, 1.f, -1.f);
data_ = glm::zero<glm::mat4>();
#if DEBUG_SCENE
num_nodes_++;
#endif
@@ -83,6 +84,7 @@ void Node::copyTransform(const Node *other)
rotation_ = other->rotation_;
translation_ = other->translation_;
crop_ = other->crop_;
data_ = other->data_;
}
void Node::update( float dt)

View File

@@ -68,7 +68,11 @@ public:
bool visible_;
uint refcount_;
glm::mat4 transform_;
glm::vec3 scale_, rotation_, translation_, crop_;
glm::vec3 scale_, rotation_, translation_;
glm::vec4 crop_;
// supplementary data
glm::mat4 data_;
// animation update callbacks
// list of callbacks to call at each update

View File

@@ -105,8 +105,8 @@ void Screenshot::captureFramebuffer(FrameBuffer *fb)
return;
bpp = (fb->flags() & FrameBuffer::FrameBuffer_alpha) ? 4 : 3;
Width = fb->width() * fb->projectionArea().x;
Height = fb->height() * fb->projectionArea().y;
Width = fb->width() * fb->projectionSize().x;
Height = fb->height() * fb->projectionSize().y;
VFlip = false;
// blit the frame buffer into an RBBA copy of cropped size

View File

@@ -785,8 +785,23 @@ void SessionLoader::XMLToNode(const tinyxml2::XMLElement *xml, Node &n)
if (rotationNode)
tinyxml2::XMLElementToGLM( rotationNode->FirstChildElement("vec3"), n.rotation_);
const XMLElement *cropNode = node->FirstChildElement("crop");
if (cropNode)
tinyxml2::XMLElementToGLM( cropNode->FirstChildElement("vec3"), n.crop_);
if (cropNode) {
const XMLElement *vecNode = cropNode->FirstChildElement("vec4");
if (vecNode)
tinyxml2::XMLElementToGLM(vecNode, n.crop_);
else {
// backward compatibility, read vec3
vecNode = cropNode->FirstChildElement("vec3");
if (vecNode) {
glm::vec3 crop;
tinyxml2::XMLElementToGLM(vecNode, crop);
n.crop_ = glm::vec4(-crop.x, crop.x, crop.y, -crop.y);
}
}
}
const XMLElement *dataNode = node->FirstChildElement("data");
if (dataNode)
tinyxml2::XMLElementToGLM( dataNode->FirstChildElement("mat4"), n.data_);
}
}

View File

@@ -294,6 +294,10 @@ XMLElement *SessionVisitor::NodeToXML(const Node &n, XMLDocument *doc)
crop->InsertEndChild( XMLElementFromGLM(doc, n.crop_) );
newelement->InsertEndChild(crop);
XMLElement *data = doc->NewElement("data");
data->InsertEndChild( XMLElementFromGLM(doc, n.data_) );
newelement->InsertEndChild(data);
return newelement;
}

View File

@@ -195,34 +195,66 @@ Source::Source(uint64_t id) : SourceCore(), id_(id), ready_(false), symbol_(null
overlays_[View::GEOMETRY] = new Group;
overlays_[View::GEOMETRY]->translation_.z = 0.15;
overlays_[View::GEOMETRY]->visible_ = false;
handles_[View::GEOMETRY][Handles::RESIZE] = new Handles(Handles::RESIZE);
handles_[View::GEOMETRY][Handles::RESIZE]->color = glm::vec4( COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::RESIZE]->translation_.z = 0.1;
overlays_[View::GEOMETRY]->attach(handles_[View::GEOMETRY][Handles::RESIZE]);
handles_[View::GEOMETRY][Handles::RESIZE_H] = new Handles(Handles::RESIZE_H);
handles_[View::GEOMETRY][Handles::RESIZE_H]->color = glm::vec4( COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::RESIZE_H]->translation_.z = 0.1;
overlays_[View::GEOMETRY]->attach(handles_[View::GEOMETRY][Handles::RESIZE_H]);
handles_[View::GEOMETRY][Handles::RESIZE_V] = new Handles(Handles::RESIZE_V);
handles_[View::GEOMETRY][Handles::RESIZE_V]->color = glm::vec4( COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::RESIZE_V]->translation_.z = 0.1;
overlays_[View::GEOMETRY]->attach(handles_[View::GEOMETRY][Handles::RESIZE_V]);
handles_[View::GEOMETRY][Handles::ROTATE] = new Handles(Handles::ROTATE);
handles_[View::GEOMETRY][Handles::ROTATE]->color = glm::vec4( COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::ROTATE]->translation_.z = 0.1;
overlays_[View::GEOMETRY]->attach(handles_[View::GEOMETRY][Handles::ROTATE]);
handles_[View::GEOMETRY][Handles::SCALE] = new Handles(Handles::SCALE);
handles_[View::GEOMETRY][Handles::SCALE]->color = glm::vec4( COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::SCALE]->translation_.z = 0.1;
overlays_[View::GEOMETRY]->attach(handles_[View::GEOMETRY][Handles::SCALE]);
// menu and manipulation switch
handles_[View::GEOMETRY][Handles::MENU] = new Handles(Handles::MENU);
handles_[View::GEOMETRY][Handles::MENU]->color = glm::vec4( COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::MENU]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::MENU]->translation_.z = 0.1;
overlays_[View::GEOMETRY]->attach(handles_[View::GEOMETRY][Handles::MENU]);
handles_[View::GEOMETRY][Handles::CROP] = new Handles(Handles::CROP);
handles_[View::GEOMETRY][Handles::CROP]->color = glm::vec4( COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::CROP]->translation_.z = 0.1;
overlays_[View::GEOMETRY]->attach(handles_[View::GEOMETRY][Handles::CROP]);
manipulator_ = new Switch;
overlays_[View::GEOMETRY]->attach(manipulator_);
Group *transform_manipulator = new Group;
manipulator_->attach(transform_manipulator);
handles_[View::GEOMETRY][Handles::RESIZE] = new Handles(Handles::RESIZE);
handles_[View::GEOMETRY][Handles::RESIZE]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::RESIZE]->translation_.z = 0.1;
transform_manipulator->attach(handles_[View::GEOMETRY][Handles::RESIZE]);
handles_[View::GEOMETRY][Handles::RESIZE_H] = new Handles(Handles::RESIZE_H);
handles_[View::GEOMETRY][Handles::RESIZE_H]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::RESIZE_H]->translation_.z = 0.1;
transform_manipulator->attach(handles_[View::GEOMETRY][Handles::RESIZE_H]);
handles_[View::GEOMETRY][Handles::RESIZE_V] = new Handles(Handles::RESIZE_V);
handles_[View::GEOMETRY][Handles::RESIZE_V]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::RESIZE_V]->translation_.z = 0.1;
transform_manipulator->attach(handles_[View::GEOMETRY][Handles::RESIZE_V]);
handles_[View::GEOMETRY][Handles::ROTATE] = new Handles(Handles::ROTATE);
handles_[View::GEOMETRY][Handles::ROTATE]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::ROTATE]->translation_.z = 0.1;
transform_manipulator->attach(handles_[View::GEOMETRY][Handles::ROTATE]);
handles_[View::GEOMETRY][Handles::SCALE] = new Handles(Handles::SCALE);
handles_[View::GEOMETRY][Handles::SCALE]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::SCALE]->translation_.z = 0.1;
transform_manipulator->attach(handles_[View::GEOMETRY][Handles::SCALE]);
handles_[View::GEOMETRY][Handles::EDIT_SHAPE] = new Handles(Handles::EDIT_SHAPE);
handles_[View::GEOMETRY][Handles::EDIT_SHAPE]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::EDIT_SHAPE]->translation_.z = 0.1;
transform_manipulator->attach(handles_[View::GEOMETRY][Handles::EDIT_SHAPE]);
Group *node_manipulator = new Group;
manipulator_->attach(node_manipulator);
handles_[View::GEOMETRY][Handles::NODE_LOWER_LEFT] = new Handles(Handles::NODE_LOWER_LEFT);
handles_[View::GEOMETRY][Handles::NODE_LOWER_LEFT]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::NODE_LOWER_LEFT]->translation_.z = 0.1;
node_manipulator->attach(handles_[View::GEOMETRY][Handles::NODE_LOWER_LEFT]);
handles_[View::GEOMETRY][Handles::NODE_UPPER_LEFT] = new Handles(Handles::NODE_UPPER_LEFT);
handles_[View::GEOMETRY][Handles::NODE_UPPER_LEFT]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::NODE_UPPER_LEFT]->translation_.z = 0.1;
node_manipulator->attach(handles_[View::GEOMETRY][Handles::NODE_UPPER_LEFT]);
handles_[View::GEOMETRY][Handles::NODE_LOWER_RIGHT] = new Handles(Handles::NODE_LOWER_RIGHT);
handles_[View::GEOMETRY][Handles::NODE_LOWER_RIGHT]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::NODE_LOWER_RIGHT]->translation_.z = 0.1;
node_manipulator->attach(handles_[View::GEOMETRY][Handles::NODE_LOWER_RIGHT]);
handles_[View::GEOMETRY][Handles::NODE_UPPER_RIGHT] = new Handles(Handles::NODE_UPPER_RIGHT);
handles_[View::GEOMETRY][Handles::NODE_UPPER_RIGHT]->color = glm::vec4(COLOR_HIGHLIGHT_SOURCE, 1.f);
handles_[View::GEOMETRY][Handles::NODE_UPPER_RIGHT]->translation_.z = 0.1;
node_manipulator->attach(handles_[View::GEOMETRY][Handles::NODE_UPPER_RIGHT]);
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;
node_manipulator->attach(handles_[View::GEOMETRY][Handles::EDIT_CROP]);
manipulator_->setActive(0);
frame = new Frame(Frame::SHARP, Frame::THIN, Frame::NONE);
frame->translation_.z = 0.1;
@@ -487,6 +519,7 @@ void Source::render()
init();
else {
// render the view into frame buffer
// NB: this also applies the color correction shader
renderbuffer_->begin();
texturesurface_->draw(glm::identity<glm::mat4>(), renderbuffer_->projection());
renderbuffer_->end();
@@ -507,9 +540,8 @@ void Source::attach(FrameBuffer *renderbuffer)
// create rendersurface_ only once
if ( rendersurface_ == nullptr) {
// create the surfaces to draw the frame buffer in the views
rendersurface_ = new FrameBufferSurface(renderbuffer_, blendingshader_);
rendersurface_ = new FrameBufferMeshSurface(renderbuffer_, blendingshader_);
groups_[View::RENDERING]->attach(rendersurface_);
groups_[View::GEOMETRY]->attach(rendersurface_);
}
@@ -662,7 +694,7 @@ float Source::alpha() const
bool Source::textureTransformed () const
{
return frame()->projectionArea() != glm::vec2(1.f) || // cropped
return frame()->projectionArea() != glm::vec4(-1.f, 1.f, 1.f, -1.f) || // cropped
group(View::TEXTURE)->rotation_.z != 0.f || // rotation
group(View::TEXTURE)->scale_ != glm::vec3(1.f) || // scaled
group(View::TEXTURE)->translation_ != glm::vec3(0.f);// displaced
@@ -789,13 +821,26 @@ void Source::update(float dt)
groups_[View::RENDERING]->scale_ = s;
// MODIFY CROP projection based on GEOMETRY crop
renderbuffer_->setProjectionArea( glm::vec2(groups_[View::GEOMETRY]->crop_) );
renderbuffer_->setProjectionArea( groups_[View::GEOMETRY]->crop_ );
// TODO : should it be applied to MIXING view?
// Mixing and layer icons scaled based on GEOMETRY crop
mixingsurface_->scale_ = groups_[View::GEOMETRY]->crop_;
mixingsurface_->scale_.x *= renderbuffer_->aspectRatio();
mixingsurface_->scale_.y = groups_[View::GEOMETRY]->crop_[1];
mixingsurface_->scale_.x = groups_[View::GEOMETRY]->crop_[2] * renderbuffer_->aspectRatio();
mixingsurface_->update(dt_);
// update nodes distortion
blendingshader_->iNodes = groups_[View::GEOMETRY]->data_;
handles_[View::GEOMETRY][Handles::NODE_LOWER_LEFT]->translation_.x = groups_[View::GEOMETRY]->data_[0].x;
handles_[View::GEOMETRY][Handles::NODE_LOWER_LEFT]->translation_.y = groups_[View::GEOMETRY]->data_[0].y;
handles_[View::GEOMETRY][Handles::NODE_UPPER_LEFT]->translation_.x = groups_[View::GEOMETRY]->data_[1].x;
handles_[View::GEOMETRY][Handles::NODE_UPPER_LEFT]->translation_.y = groups_[View::GEOMETRY]->data_[1].y;
handles_[View::GEOMETRY][Handles::NODE_LOWER_RIGHT]->translation_.x = groups_[View::GEOMETRY]->data_[2].x;
handles_[View::GEOMETRY][Handles::NODE_LOWER_RIGHT]->translation_.y = groups_[View::GEOMETRY]->data_[2].y;
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;
// 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;
@@ -996,4 +1041,19 @@ void Source::clearMixingGroup()
}
glm::vec2 Source::attractor(size_t i) const
{
glm::vec2 ret(0.f);
i = CLAMP(i, 0, 3);
ret.x = blendingshader_->iNodes[i].z;
ret.y = blendingshader_->iNodes[i].w;
return ret;
}
void Source::setAttractor(size_t i, glm::vec2 a)
{
i = CLAMP(i, 0, 3);
blendingshader_->iNodes[i].z = a.x;
blendingshader_->iNodes[i].w = a.y;
}

View File

@@ -40,6 +40,7 @@ class MaskShader;
class ImageProcessingShader;
class FrameBuffer;
class FrameBufferSurface;
class FrameBufferMeshSurface;
class Frame;
class Handles;
class Symbol;
@@ -284,6 +285,9 @@ public:
SourceLink processingshader_link_;
glm::vec2 attractor(size_t i) const;
void setAttractor(size_t i, glm::vec2 a);
protected:
// name
std::string name_;
@@ -301,7 +305,7 @@ protected:
// the rendersurface draws the renderbuffer in the scene
// It is associated to the rendershader for mixing effects
FrameBufferSurface *rendersurface_;
FrameBufferMeshSurface *rendersurface_;
// for the mixer, we have a surface with stippling to show
// the rendering, and a preview of the original texture
@@ -328,9 +332,9 @@ 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*[7]> handles_;
std::map<View::Mode, Handles*[12]> handles_;
Handles *lock_, *unlock_;
Switch *locker_;
Switch *locker_, *manipulator_;
Symbol *symbol_;
Character *initial_0_, *initial_1_;

View File

@@ -216,7 +216,7 @@ void ResetGeometry::update(Source *s, float dt)
s->group(View::GEOMETRY)->scale_ = glm::vec3(1.f);
s->group(View::GEOMETRY)->rotation_.z = 0;
s->group(View::GEOMETRY)->crop_ = glm::vec3(1.f);
s->group(View::GEOMETRY)->crop_ = glm::vec4(-1.f, 1.f, 1.f, -1.f);
s->group(View::GEOMETRY)->translation_ = glm::vec3(0.f);
s->touch();

View File

@@ -1027,7 +1027,7 @@ void DrawSource(Source *s, ImVec2 framesize, ImVec2 top_image, bool withslider,
//
// RIGHT of slider : post-processed image (after crop and color correction)
//
ImVec2 cropsize = framesize * ImVec2 ( s->frame()->projectionArea().x, s->frame()->projectionArea().y);
ImVec2 cropsize = framesize * ImVec2 ( s->frame()->projectionSize().x, s->frame()->projectionSize().y);
ImVec2 croptop = (framesize - cropsize) * 0.5f;
// no overlap of slider with cropped area
if (slider.x < croptop.x) {

View File

@@ -1016,7 +1016,7 @@ void TextureView::draw()
if (ImGui::Selectable( ICON_FA_VECTOR_SQUARE " Reset" )){
s->group(mode_)->scale_ = glm::vec3(1.f);
s->group(mode_)->rotation_.z = 0;
s->group(mode_)->crop_ = glm::vec3(1.f);
// s->group(mode_)->crop_ = glm::vec3(1.f);
s->group(mode_)->translation_ = glm::vec3(0.f);
s->touch();
Action::manager().store(s->name() + std::string(": Texture Reset"));
@@ -1033,7 +1033,8 @@ void TextureView::draw()
}
if (ImGui::Selectable( ICON_FA_EXPAND_ALT " Reset aspect ratio" )){
s->group(mode_)->scale_.x = s->group(mode_)->scale_.y;
s->group(mode_)->scale_.x *= s->group(mode_)->crop_.x / s->group(mode_)->crop_.y;
s->group(mode_)->scale_.x *= (s->group(mode_)->crop_[1] - s->group(mode_)->crop_[0]) /
(s->group(mode_)->crop_[2] - s->group(mode_)->crop_[3]);
s->touch();
Action::manager().store(s->name() + std::string(": Texture Reset aspect ratio"));
}

View File

@@ -4339,10 +4339,10 @@ void Navigator::RenderMainPannelSession()
//
Session *se = Mixer::manager().session();
float width = preview_width;
float height = se->frame()->projectionArea().y * width / ( se->frame()->projectionArea().x * se->frame()->aspectRatio());
float height = se->frame()->projectionSize().y * width / ( se->frame()->projectionSize().x * se->frame()->aspectRatio());
if (height > preview_height - space) {
height = preview_height - space;
width = height * se->frame()->aspectRatio() * ( se->frame()->projectionArea().x / se->frame()->projectionArea().y);
width = height * se->frame()->aspectRatio() * ( se->frame()->projectionSize().x / se->frame()->projectionSize().y);
}
// centered image
ImGui::SetCursorPos( ImVec2(pos.x + 0.5f * (preview_width-width), pos.y + 0.5f * (preview_height-height-space)) );
@@ -5857,10 +5857,10 @@ void Thumbnail::Render(float width)
#define SEGMENT_ARRAY_MAX 1000
#define MAXSIZE 65535
#include <glm/gtc/type_ptr.hpp>
void ShowSandbox(bool* p_open)
{
ImGui::SetNextWindowPos(ImVec2(100, 100), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(400, 260), ImGuiCond_FirstUseEver);
if (!ImGui::Begin( ICON_FA_BABY_CARRIAGE " Sandbox", p_open))
{
@@ -5871,46 +5871,65 @@ void ShowSandbox(bool* p_open)
ImGui::Text("Testing sandox");
ImGui::Separator();
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_BOLD);
ImGui::Text("This text is in BOLD");
ImGui::PopFont();
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_DEFAULT);
ImGui::Text("This text is in REGULAR");
ImGui::PopFont();
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_ITALIC);
ImGui::Text("This text is in ITALIC");
ImGui::PopFont();
ImGui::Text("IMAGE of Font");
ImGuiToolkit::ImageGlyph(ImGuiToolkit::FONT_DEFAULT, 'v');
ImGui::SameLine();
ImGuiToolkit::ImageGlyph(ImGuiToolkit::FONT_BOLD, 'i');
ImGui::SameLine();
ImGuiToolkit::ImageGlyph(ImGuiToolkit::FONT_ITALIC, 'm');
ImGui::SameLine();
ImGuiToolkit::ImageGlyph(ImGuiToolkit::FONT_MONO, 'i');
ImGui::SameLine();
ImGuiToolkit::ImageGlyph(ImGuiToolkit::FONT_LARGE, 'x');
ImGui::Separator();
ImGui::Text("Source list");
Session *se = Mixer::manager().session();
for (auto sit = se->begin(); sit != se->end(); ++sit) {
ImGui::Text("[%s] %s ", std::to_string((*sit)->id()).c_str(), (*sit)->name().c_str());
}
ImGui::Separator();
static char str[128] = "";
ImGui::InputText("Command", str, IM_ARRAYSIZE(str));
if ( ImGui::Button("Execute") )
SystemToolkit::execute(str);
ImGui::Text("Current source");
static char str0[128] = "àöäüèáû вторая строчка";
ImGui::InputText("##inputtext", str0, IM_ARRAYSIZE(str0));
std::string tra = BaseToolkit::transliterate(std::string(str0));
ImGui::Text("Transliteration: '%s'", tra.c_str());
Source *so = Mixer::manager().currentSource();
if (so) {
glm::vec2 v = so->attractor(0);
if (ImGui::SliderFloat2("LL corner", glm::value_ptr(v), 0.0, 2.0))
so->setAttractor(0,v);
v = so->attractor(1);
if (ImGui::SliderFloat2("UL corner", glm::value_ptr(v), 0.0, 2.0))
so->setAttractor(1,v);
v = so->attractor(2);
if (ImGui::SliderFloat2("LR corner", glm::value_ptr(v), 0.0, 2.0))
so->setAttractor(2,v);
v = so->attractor(3);
if (ImGui::SliderFloat2("UR corner", glm::value_ptr(v), 0.0, 2.0))
so->setAttractor(3,v);
}
// ImGui::Separator();
// static char str[128] = "";
// ImGui::InputText("Command", str, IM_ARRAYSIZE(str));
// if ( ImGui::Button("Execute") )
// SystemToolkit::execute(str);
// ImGuiToolkit::PushFont(ImGuiToolkit::FONT_BOLD);
// ImGui::Text("This text is in BOLD");
// ImGui::PopFont();
// ImGuiToolkit::PushFont(ImGuiToolkit::FONT_DEFAULT);
// ImGui::Text("This text is in REGULAR");
// ImGui::PopFont();
// ImGuiToolkit::PushFont(ImGuiToolkit::FONT_ITALIC);
// ImGui::Text("This text is in ITALIC");
// ImGui::PopFont();
// ImGui::Text("IMAGE of Font");
// ImGuiToolkit::ImageGlyph(ImGuiToolkit::FONT_DEFAULT, 'v');
// ImGui::SameLine();
// ImGuiToolkit::ImageGlyph(ImGuiToolkit::FONT_BOLD, 'i');
// ImGui::SameLine();
// ImGuiToolkit::ImageGlyph(ImGuiToolkit::FONT_ITALIC, 'm');
// ImGui::SameLine();
// ImGuiToolkit::ImageGlyph(ImGuiToolkit::FONT_MONO, 'i');
// ImGui::SameLine();
// ImGuiToolkit::ImageGlyph(ImGuiToolkit::FONT_LARGE, 'x');
// static char str0[128] = "àöäüèáû вторая строчка";
// ImGui::InputText("##inputtext", str0, IM_ARRAYSIZE(str0));
// std::string tra = BaseToolkit::transliterate(std::string(str0));
// ImGui::Text("Transliteration: '%s'", tra.c_str());
// ImGui::Separator();

View File

@@ -181,6 +181,7 @@ protected:
// internal
char inifilepath[2048];
uint64_t start_time;
bool mousedown;
bool ctrl_modifier_active;
bool alt_modifier_active;
bool shift_modifier_active;

View File

@@ -5,7 +5,7 @@
#define APP_TITLE "Video Live Mixer"
#define APP_SETTINGS "vimix.xml"
#define XML_VERSION_MAJOR 0
#define XML_VERSION_MINOR 3
#define XML_VERSION_MINOR 4
#define MAX_RECENT_HISTORY 20
#define MAX_SESSION_LEVEL 3
#define MAX_OUTPUT_WINDOW 3