Illustrated Mirroring and Collapsing of Points



May 21st, 2020 by Diana Coman

While I can ~never be absolutely certain the implementation is a bug-free translation of the spec, I can certainly check again and check better and take a break from that code before checking then yet again with fresh eyes and even concrete illustrations to try as best as possible to either find the trouble or otherwise set the matter to rest and set own mind at rest that there isn't anything to that niggling thought that somewhere kept insisting that hm, *some* of those hopefuls in the 4th parade are not quite as expected, somehow.

So I left the generator code alone for a few days and did instead all the writing of textures and then some more writing and different code and new textures and even various other code tidy ups before I sat down again to recalculate all the formulae (it's not the first time either), to re-read the whole code and to check - with pictures if need be! - that it does as expected. The formulae turned out the same and correct, everything supposedly was fine except... a typo, of course, what fucking else. I fixed it and then tracked back to see where it got in exactly: at the moment when I switched from mirroring only original points to mirroring all in the 2nd plane, so it affects only generation 4 (and only the hopefuls with sym2), not any of the previous generations nor the sym1 hopefuls of gen4. So thank you for giving voice to that doubt and asking that question, apologies for the mess up and I'll try to take that needed break in the future before it's overdue rather than after.

With the fix in, I ran again the whole testing step by step and took screenshots to provide a clearer illustration of this whole important symmetry part, as I think it might help even to spot if there's anything else unexpected/undesired in there. To help make the points clear, I ran each step twice: once with normal fit of the mesh on the full bone's length and once with fitting the mesh only on the end point of the bone (and a fixed, small size, 0.02, so that something is visible). Step 1 is just the set of pseudo-randomly chosen points (7 inside the volume, 17 on the surface of the unit sphere), without any mirroring (nor collapsing) at all, first normal fit of the mesh, then end-of-bone fit:

a01_nomirroring_skel_99_vol7_7_srf17_17_sym_1_tex1_rotxyz297_124_65_640.jpg
b01_nomirroring_skel_99_vol7_7_srf17_17_sym_1_tex1_rotxyz297_124_65_640.jpg

Step 2 uses the same seed as above but adds mirroring in one and then in both planes *without* any collapsing - so you can see visually the symmetry introduced:

a02_mirrornocollapse_skel_99_vol7_7_srf17_17_sym_1_tex1_rotxyz297_124_65_640.jpg
b02_mirrornocollapse_skel_99_vol7_7_srf17_17_sym_1_tex1_rotxyz297_124_65_640.jpg
a02_mirrornocollapse_skel_99_vol7_7_srf17_17_sym_2_tex1_rotxyz297_124_65_640.jpg
b02_mirrornocollapse_skel_99_vol7_7_srf17_17_sym_2_tex1_rotxyz297_124_65_640.jpg

Worth noting here since I'm going in detail through it anyway: the 2nd plane of symmetry is obtained by taking first the 2 points that are furthest apart and then a 3rd point that is closest to those 2 but *also* not collinear to them (since collinear wouldn't help to define a plane); at the moment I'm not checking anywhere specifically so that all points are distinct. In principle this can introduce ~duplicate points - either by pure chance or by the weird effects of working with floating point numbers on the computer, since the distance of a point to the plane that contains it may still end up not-exactly-zero so that the mirroring can literally double the points, nevermind that 3 of them are in principle their own mirroring. Even if introduced, those duplicate points are the first ones to go at collapsing time but it's true that they would in principle affect that calculated average distance so let me know if this is a problem and you'd rather I add checks to prevent it entirely.

Finally, step 3 uses the same seed and does mirrorings as above but adds afterwards the collapsing too:

a03_mirror_collapse_skel_99_vol7_7_srf17_17_sym_1_tex1_rotxyz297_124_65_640.jpg
b03_mirror_collapse_skel_99_vol7_7_srf17_17_sym_1_tex1_rotxyz297_124_65_640.jpg
a03_mirror_collapse_skel_99_vol7_7_srf17_17_sym_2_tex1_rotxyz297_124_65_640.jpg
b03_mirror_collapse_skel_99_vol7_7_srf17_17_sym_2_tex1_rotxyz297_124_65_640.jpg

Let me know if there's anything else looking dubious in the above and/or if there's something else to change regarding this mirroring and collapsing of points.

Update with the required data dump for seed 99. Note that the dump rounded to 2 decimals above while the script works with the values not rounded (hence also the mirroring at distance -0.00 - the check is too strict and so there is this, as I mentioned in the text):
Initial points:
0.28 -0.55 0.38
-0.01 -0.02 -0.01
-0.01 -0.01 -0.18
-0.04 -0.02 -0.26
0.23 -0.01 0.51
-0.00 0.00 -0.01
-0.01 -0.25 -0.01
-0.72 0.70 -0.72
-0.87 0.03 -1.00
0.84 -0.40 0.90
-0.72 0.55 -0.79
0.85 -0.14 0.99
-0.91 -0.14 -0.99
0.68 0.46 0.83
0.33 -0.79 0.39
0.23 0.93 0.24
-0.70 -0.25 -0.94
-0.21 0.77 -0.26
0.31 -0.71 0.40
0.11 -0.21 0.47
0.17 0.94 0.18
-0.59 -0.76 -0.61
0.11 0.08 0.83
-0.79 0.49 -0.85
Symmetry plane 1 determined by the 2 furthest away points 11 and 12, together with 3rd closest (and non-collinear), 6:
0.85 -0.14 0.99
-0.91 -0.14 -0.99
-0.01 -0.25 -0.01
Equation symplane1: -0.21 * x + (-0.06) * y + (0.19) * z + (-0.01) = 0
Reflected points in symplane1:
Point 24 reflection of 0 at distance -0.10 from plane: 0.32 -0.54 0.34
Point 25 reflection of 1 at distance 0.05 from plane: -0.03 -0.02 0.01
Point 26 reflection of 2 at distance 0.15 from plane: -0.08 -0.02 -0.12
Point 27 reflection of 3 at distance 0.19 from plane: -0.12 -0.04 -0.19
Point 28 reflection of 4 at distance -0.12 from plane: 0.28 -0.00 0.47
Point 29 reflection of 5 at distance 0.05 from plane: -0.02 -0.00 0.01
Point 30 reflection of 6 at distance -0.00 from plane: -0.01 -0.25 -0.01
Point 31 reflection of 7 at distance 0.13 from plane: -0.77 0.68 -0.67
Point 32 reflection of 8 at distance 0.07 from plane: -0.90 0.02 -0.97
Point 33 reflection of 9 at distance -0.00 from plane: 0.84 -0.40 0.90
Point 34 reflection of 10 at distance 0.15 from plane: -0.78 0.54 -0.74
Point 35 reflection of 12 at distance -0.00 from plane: -0.91 -0.14 -0.99
Point 36 reflection of 13 at distance 0.09 from plane: 0.64 0.45 0.87
Point 37 reflection of 14 at distance -0.12 from plane: 0.38 -0.78 0.34
Point 38 reflection of 15 at distance 0.24 from plane: 0.13 0.91 0.33
Point 39 reflection of 16 at distance 0.10 from plane: -0.74 -0.26 -0.90
Point 40 reflection of 17 at distance 0.22 from plane: -0.30 0.74 -0.18
Point 41 reflection of 18 at distance -0.12 from plane: 0.37 -0.69 0.36
Point 42 reflection of 19 at distance -0.22 from plane: 0.20 -0.19 0.39
Point 43 reflection of 20 at distance 0.24 from plane: 0.07 0.92 0.27
Point 44 reflection of 21 at distance -0.13 from plane: -0.54 -0.75 -0.66
Point 45 reflection of 22 at distance -0.39 from plane: 0.28 0.12 0.68
Point 46 reflection of 23 at distance 0.12 from plane: -0.84 0.48 -0.81

Symmetry plane 2 based on normal to plane1 & going through 2 furthest away points:
-0.11 * x + (0.75) * y + (0.10) * z + (0.10) = 0

Point 47 reflection of 0 at distance 0.52 from plane: 0.17 0.23 0.48
Point 48 reflection of 1 at distance -0.15 from plane: 0.03 -0.25 -0.04
Point 49 reflection of 2 at distance -0.14 from plane: 0.02 -0.22 -0.20
Point 50 reflection of 3 at distance -0.11 from plane: -0.01 -0.19 -0.28
Point 51 reflection of 4 at distance -0.20 from plane: 0.28 -0.31 0.47
Point 52 reflection of 5 at distance -0.18 from plane: 0.04 -0.27 -0.04
Point 53 reflection of 6 at distance 0.14 from plane: -0.04 -0.03 0.02
Point 54 reflection of 7 at distance -1.08 from plane: -0.48 -0.93 -0.93
Point 55 reflection of 8 at distance -0.21 from plane: -0.82 -0.29 -1.04
Point 56 reflection of 9 at distance 0.35 from plane: 0.77 0.12 0.97
Point 57 reflection of 10 at distance -0.89 from plane: -0.52 -0.78 -0.97
Point 58 reflection of 11 at distance -0.00 from plane: 0.85 -0.14 0.99
Point 59 reflection of 12 at distance -0.00 from plane: -0.91 -0.14 -0.99
Point 60 reflection of 13 at distance -0.77 from plane: 0.85 -0.70 0.68
Point 61 reflection of 14 at distance 0.84 from plane: 0.15 0.46 0.55
Point 62 reflection of 15 at distance -1.37 from plane: 0.53 -1.12 -0.03
Point 63 reflection of 16 at distance 0.17 from plane: -0.74 0.01 -0.91
Point 64 reflection of 17 at distance -1.15 from plane: 0.05 -0.96 -0.49
Point 65 reflection of 18 at distance 0.73 from plane: 0.15 0.38 0.55
Point 66 reflection of 19 at distance 0.04 from plane: 0.10 -0.16 0.48
Point 67 reflection of 20 at distance -1.39 from plane: 0.48 -1.13 -0.10
Point 68 reflection of 21 at distance 0.80 from plane: -0.77 0.43 -0.46
Point 69 reflection of 22 at distance -0.39 from plane: 0.20 -0.51 0.75
Point 70 reflection of 23 at distance -0.81 from plane: -0.61 -0.73 -1.01
Point 71 reflection of 24 at distance 0.52 from plane: 0.21 0.24 0.44
Point 72 reflection of 25 at distance -0.15 from plane: 0.01 -0.25 -0.02
Point 73 reflection of 26 at distance -0.14 from plane: -0.05 -0.23 -0.15
Point 74 reflection of 27 at distance -0.11 from plane: -0.09 -0.21 -0.21
Point 75 reflection of 28 at distance -0.20 from plane: 0.33 -0.30 0.43
Point 76 reflection of 29 at distance -0.18 from plane: 0.02 -0.27 -0.02
Point 77 reflection of 30 at distance 0.14 from plane: -0.04 -0.03 0.02
Point 78 reflection of 31 at distance -1.08 from plane: -0.53 -0.94 -0.88
Point 79 reflection of 32 at distance -0.21 from plane: -0.85 -0.29 -1.02
Point 80 reflection of 33 at distance 0.35 from plane: 0.77 0.12 0.97
Point 81 reflection of 34 at distance -0.89 from plane: -0.58 -0.79 -0.91
Point 82 reflection of 35 at distance -0.00 from plane: -0.91 -0.14 -0.99
Point 83 reflection of 36 at distance -0.77 from plane: 0.81 -0.71 0.71
Point 84 reflection of 37 at distance 0.84 from plane: 0.20 0.48 0.51
Point 85 reflection of 38 at distance -1.37 from plane: 0.43 -1.15 0.06
Point 86 reflection of 39 at distance 0.17 from plane: -0.78 -0.00 -0.87
Point 87 reflection of 40 at distance -1.15 from plane: -0.04 -0.99 -0.41
Point 88 reflection of 41 at distance 0.73 from plane: 0.20 0.39 0.50
Point 89 reflection of 42 at distance 0.04 from plane: 0.20 -0.13 0.40
Point 90 reflection of 43 at distance -1.39 from plane: 0.38 -1.16 -0.01
Point 91 reflection of 44 at distance 0.80 from plane: -0.71 0.44 -0.51
Point 92 reflection of 45 at distance -0.39 from plane: 0.37 -0.47 0.60
Point 93 reflection of 46 at distance -0.81 from plane: -0.66 -0.74 -0.97

Fwiw I calculated yet again the plane equations and I still don't see anything wrong with them. Perhaps there's something going wrong at reflection itself, so I'll re-calc that too, though tomorrow with a fresher mind.

Updated 22 May 2020: *fixed* the incorrect use of size of normal instead of squared size of normal when calculating the lambda for the first plane. Updated data dump with full decimals too:
Seed 99
Initial points:
0.281813 -0.548861 0.380002
-0.005405 -0.017001 -0.009531
-0.012594 -0.005508 -0.177122
-0.038420 -0.020412 -0.262836
0.230660 -0.013599 0.512881
-0.003318 0.003075 -0.005014
-0.005029 -0.247561 -0.005563
-0.717715 0.696048 -0.717859
-0.870788 0.032036 -0.999324
0.842434 -0.403239 0.901994
-0.717069 0.552947 -0.791900
0.851877 -0.140657 0.986641
-0.910115 -0.140719 -0.988257
0.682939 0.455476 0.831947
0.331493 -0.788936 0.387371
0.228824 0.932114 0.238411
-0.698641 -0.248287 -0.942265
-0.208097 0.765032 -0.262473
0.312717 -0.708648 0.403725
0.111998 -0.209795 0.470940
0.170545 0.944810 0.177637
-0.592100 -0.761696 -0.613727
0.112007 0.076307 0.826439
-0.791548 0.490804 -0.849881
Symmetry plane 1
2 furthest away points 11 and 12:
0.851877 -0.140657 0.986641
-0.910115 -0.140719 -0.988257
3rd point closest to the above, 6: -0.005029 -0.247561 -0.005563
Normal symplane1: -0.211063 -0.055953 0.188303
d=-0.013857
Point 24 reflection of 0 with lambda -0.347961: 0.428696 -0.509922 0.248958
Point 25 reflection of 1 with lambda 0.163105: -0.074256 -0.035254 0.051896
Point 26 reflection of 2 with lambda 0.532182: -0.237242 -0.065063 0.023300
Point 27 reflection of 3 with lambda 0.650727: -0.313109 -0.093233 -0.017769
Point 28 reflection of 4 with lambda -0.418546: 0.407339 0.033239 0.355254
Point 29 reflection of 5 with lambda 0.171685: -0.075791 -0.016138 0.059644
Point 30 reflection of 6 with lambda -0.000101: -0.004987 -0.247550 -0.005601
Point 31 reflection of 7 with lambda 0.438981: -0.903020 0.646923 -0.552537
Point 32 reflection of 8 with lambda 0.240978: -0.972511 0.005069 -0.908570
Point 33 reflection of 9 with lambda -0.008977: 0.846223 -0.402235 0.898613
Point 34 reflection of 10 with lambda 0.512010: -0.933202 0.495649 -0.599075
Point 35 reflection of 12 with lambda -0.000201: -0.910030 -0.140697 -0.988333
Point 36 reflection of 13 with lambda 0.322703: 0.546718 0.419363 0.953479
Point 37 reflection of 14 with lambda -0.400105: 0.500388 -0.744161 0.236689
Point 38 reflection of 15 with lambda 0.834958: -0.123634 0.838677 0.552861
Point 39 reflection of 16 with lambda 0.360113: -0.850654 -0.288586 -0.806645
Point 40 reflection of 17 with lambda 0.747765: -0.523748 0.681352 0.019139
Point 41 reflection of 18 with lambda -0.430777: 0.494559 -0.660441 0.241492
Point 42 reflection of 19 with lambda -0.756851: 0.431485 -0.125098 0.185906
Point 43 reflection of 20 with lambda 0.833199: -0.181170 0.851569 0.491424
Point 44 reflection of 21 with lambda -0.459078: -0.398311 -0.710322 -0.786619
Point 45 reflection of 22 with lambda -1.369474: 0.690098 0.229560 0.310687
Point 46 reflection of 23 with lambda 0.412428: -0.965645 0.444651 -0.694559
Symmetry plane 2 based on normal to plane1 & going through 2 furthest away points:
-0.110514 * x + (0.748616) * y + (0.098576) * z + (0.102183) = 0
Point 47 reflection of 0 with lambda 0.519249: 0.167044 0.228576 0.482373
Point 48 reflection of 1 with lambda -0.153022: 0.028417 -0.246110 -0.039699
Point 49 reflection of 2 with lambda -0.140792: 0.018525 -0.216306 -0.204880
Point 50 reflection of 3 with lambda -0.112025: -0.013659 -0.188139 -0.284922
Point 51 reflection of 4 with lambda -0.201026: 0.275092 -0.314582 0.473248
Point 52 reflection of 5 with lambda -0.179198: 0.036290 -0.265226 -0.040343
Point 53 reflection of 6 with lambda 0.142761: -0.036584 -0.033814 0.022582
Point 54 reflection of 7 with lambda -1.084918: -0.477917 -0.928326 -0.931754
Point 55 reflection of 8 with lambda -0.212739: -0.823766 -0.286484 -1.041266
Point 56 reflection of 9 with lambda 0.350085: 0.765055 0.120919 0.971014
Point 57 reflection of 10 with lambda -0.888306: -0.520729 -0.777054 -0.967032
Point 58 reflection of 11 with lambda -0.000000: 0.851877 -0.140657 0.986641
Point 59 reflection of 12 with lambda -0.000000: -0.910115 -0.140719 -0.988257
Point 60 reflection of 13 with lambda -0.772199: 0.853617 -0.700686 0.679706
Point 61 reflection of 14 with lambda 0.836044: 0.146703 0.462817 0.552200
Point 62 reflection of 15 with lambda -1.370623: 0.531771 -1.120028 -0.031811
Point 63 reflection of 16 with lambda 0.170624: -0.736354 0.007177 -0.908626
Point 64 reflection of 17 with lambda -1.153969: 0.046963 -0.962729 -0.489982
Point 65 reflection of 18 with lambda 0.726503: 0.152139 0.379097 0.546957
Point 66 reflection of 19 with lambda 0.035763: 0.104093 -0.156249 0.477991
Point 67 reflection of 20 with lambda -1.387716: 0.477270 -1.132924 -0.095955
Point 68 reflection of 21 with lambda 0.795214: -0.767865 0.428925 -0.456949
Point 69 reflection of 22 with lambda -0.392193: 0.198692 -0.510897 0.749117
Point 70 reflection of 23 with lambda -0.812742: -0.611909 -0.726060 -1.010116
Point 71 reflection of 24 with lambda 0.519249: 0.313928 0.267515 0.351329
Point 72 reflection of 25 with lambda -0.153022: -0.040434 -0.264363 0.021727
Point 73 reflection of 26 with lambda -0.140792: -0.206123 -0.275861 -0.004457
Point 74 reflection of 27 with lambda -0.112025: -0.288348 -0.260960 -0.039855
Point 75 reflection of 28 with lambda -0.201026: 0.451772 -0.267744 0.315621
Point 76 reflection of 29 with lambda -0.179198: -0.036183 -0.284439 0.024314
Point 77 reflection of 30 with lambda 0.142761: -0.036541 -0.033803 0.022544
Point 78 reflection of 31 with lambda -1.084918: -0.663223 -0.977451 -0.766431
Point 79 reflection of 32 with lambda -0.212739: -0.925490 -0.313451 -0.950512
Point 80 reflection of 33 with lambda 0.350085: 0.768844 0.121923 0.967633
Point 81 reflection of 34 with lambda -0.888306: -0.736862 -0.834352 -0.774207
Point 82 reflection of 35 with lambda -0.000000: -0.910030 -0.140697 -0.988333
Point 83 reflection of 36 with lambda -0.772199: 0.717395 -0.736798 0.801238
Point 84 reflection of 37 with lambda 0.836044: 0.315599 0.507592 0.401518
Point 85 reflection of 38 with lambda -1.370623: 0.179312 -1.213465 0.282639
Point 86 reflection of 39 with lambda 0.170624: -0.888367 -0.033122 -0.773006
Point 87 reflection of 40 with lambda -1.153969: -0.268688 -1.046409 -0.208369
Point 88 reflection of 41 with lambda 0.726503: 0.333982 0.427304 0.384724
Point 89 reflection of 42 with lambda 0.035763: 0.423580 -0.071553 0.192956
Point 90 reflection of 43 with lambda -1.387716: 0.125554 -1.226164 0.217832
Point 91 reflection of 44 with lambda 0.795214: -0.574076 0.480299 -0.629840
Point 92 reflection of 45 with lambda -0.392193: 0.776783 -0.357644 0.233366
Point 93 reflection of 46 with lambda -0.812742: -0.786006 -0.772213 -0.854793

Comments feed: RSS 2.0

13 Responses to “Illustrated Mirroring and Collapsing of Points”

  1. Diana Coman says:

    All images above are displayed as generated, *not* rotated, despite what the filename says (for this testing stage I took out the rotation as it wasn't helping at all).

  2. I'll try to take that needed break in the future before it's overdue rather than after.

    These things happen, I don't think an errorless life is a practical possibility - not in this, as not in any other lines.

    Nevertheless, an error doesn't have to become a mistake (nor does it have any power of its own to transform itself into a mistake). Until someone refuses to correct it, mere error has no more power upon human life than any other bugaboo from beyond. Like the Hasidic malevolent spirits of the dead, it does nothing nor can do anything until specifically invited into the home ; so I'd say the only praiseworthy party here is you, for having had the maturity to sit the fuck down, shut the fatlogic up, and look at the matter clearly. This is a merit whether anything is found or not, it's simply the basis of all ethics as well as any meaningful human activity.

    So kudos an' move on.

    so you can see visually the symmetry introduced:

    I am rather certain now that it is indeed not doing what I had in mind.

    Let's look at b02_mirrornocollapse_skel_99_vol7_7_srf17_17_sym_2_tex1_rotxyz297_124_65_640.jpg ; in this image there's a readily distinguishable cluser at the top, formed of 6 pairs disposed on three lines, 7 ; 2-2-------2---22 ; 2.

    Problematizing approach #1. We can observe that the distance separating each of these seven pairs stands within a very narrow range, for all of them : from about .05 to about 0.08 unit-sphere-radii or thereabouts, guesstimating from the 2d render. This disposition is not statitically likely : chosing random points inside a sphere and a random symmetry plane will result in a majority of the points being mirrored outside the original sphere, meaning MORE than unit-sphere-radius away from each other. This is a statistical necessity : the symmetry plane is just as likely to be within -r/2 ; +r/2 of the center of the sphere as it is to be outside ; whether it is or whether it isn't, all the points on the opposite side of the plane-chosen-to-be-parallel-to-the-symmetry-plane-and-also-include-the-sphere-center that are either outside of that r/2 range, or else inside when the sphere's itself outside, will gain more than r total projection. So for these reasons I suspect the symmetry plane is not chosen correctly.

    Problematizing approach #2 Looking specifically at the very close two pairs towards the end of the 2nd (middle) line, it would appear that the imaginary lines uniting each pair are indeed paralel, and they go from somewhere behind the image to the left and up of the observer towards somewhere before the image to the right and lower of the observer. Turning now our attention to the pair immediately to their left, it would appear that either (it's ambiguous there being a single pair) the imaginary line uniting them goes from slightly upper and very far to the right to slighly lower and very far to the left or else vice-versa. It is not possible for all these three pairs to be mirrored around the same plane for this reason, the change in orientation is too drastic ; moreover their putative plane can not be reconciled with yet another pair to the left, which suggests yet another and drastically different orientation, or with the rest of the points in general.

    In any case it'd appear from regarding that image that indeed the original points (before being mirrored), far from finding themselves inside a sphere, in fact found themselves inside a very thin parallelepiped, of height no more than at most a tenth (rather less) its width.

    I suppose diagnosis here should proceed by doing some numeric work instead of display. So please, for the imagine in question : dump the absolute coordinates of the original points as defined ; indicate the points that define the symmetry plane ; dump the absolute coordinates of the mirror points (all this before any collapsing). I think that'll make it very plain.

  3. Diana Coman says:

    Before dumping the numbers, one thing stands out to me in your comment - why do you assume it includes the sphere center? It doesn't anymore, the plane is calculated based on 2 most distant points + closest to them (as sum of distances).

    Points are also pseudo-randomly chosen to start with. The sym2 plane is in this case closer to horizontal and causes e.g. those points in upper left to end up mirrored at the very bottom left, almost into the ground - which btw IS outside the sphere because the whole thing is render more than 1r *above* the ground. So I'm not sure I follow what/how it's not doing the planes as spec.

    I'll re-read though the comment in a while, maybe I can figure out.

  4. Diana Coman says:

    Updated with the data dump requested.

  5. Diana Coman says:

    And in further data-dumping gahs: 1. the "distance" is a misleading label - it's the lambda parameter of the vector equation of the perpendicular line from original point to plane (since mirroring calculates that and doubles it to find the mirrored point) 2. there was a "-" that got lost at paste apparently for point 6 3. the equation of the plane was reported wrongly as - (d) by the dump while the script uses the + d. Corrected those in the dump above - it turns out the dump itself is more difficult to get correctly than the equations, at least at this hour.

  6. > why do you assume it includes the sphere center?

    I don't.

    > Point 33 reflection of 9 at distance -0.00 from plane: 0.84 -0.40 0.90

    Leaving aside how point 11 is missing from the list altogether (12 is there), how is this possible ? -0.21 * .84 + (-0.06) * -.4 + (0.19) * .9 + (-0.01) = 0.01 ? or is it rounding down ?

    In any case, I believe there's very obviously something wrong with the ~first~ symmetry calculation. Look at the distances, the 2nd symmetry (on the normal plane) returns distances in the expected range, averaging to 0.52893617 (over 47 points ?!). Meanwhile the 1st symmetry returns way outside the expected range, 0.130434783 (over 23 points). For the reasons I was belabouring in my earlier comment, the distance should average somewhere over .5, there's just no way it goes so low as .13, that's many sigmas away from a common occurence.

    I'd say you have some massive bias source somewhere in there, which is usually indicative of error.

  7. Diana Coman says:

    Point 11 is missing because its distance is (close enough to) 0. There is a check to not duplicate points - it's just strict on 0 and that works as expected (badly) with floating point - I suppose I could either fully dispense with the check altogether or otherwise do a proper check floating-point style, there is that but I doubt it has much impact.

    On top of the above, there is ALSO the 2 decimals printf of the data dump. So I guess I'll dump also the values with full number of decimals, at least there won't be the further why 12 but not 11.

    There are 7/17 points to start with: 17+7=24; as they are counted from 0, indeed, points 0 to 23 (and not duplicating 11, so indeed 23 points are mirrored in plane 1 but it's not that the one on the plane is dumped now or some shit so yes, the total that mirroring 2 has to work with is 24 original + 23 mirrored = 47).

    I'll check again the mirroring itself today since that was on the list anyway.

  8. Diana Coman says:

    It turns out fresh brain was indeed required to spot the 2nd error which was in none of the suspected places, of course: the calculation of lambda uses the squared size of the normal but for the first plane, the value used was in fact the actual size (ie square rooted) and that threw off then ~everything - the mirrored points in plane 1 were along the correct direction but too close to the original point.

    I've fixed that and updated with a dump with full decimals too and proper labeling as lambda rather than distance (because while close-to, it's not the distance and *that* mislabeling is in the end at the very root of this error in the first place, ugh).

    On the sad side, this means that the full gen4 of hopefuls is borked. On the learning side, I'll clearly promote the check for bias as part and parcel of first check and certainly before 3rd re-reading or similars.

    What would be preferable to do about mirroring the points in the plane? There are several options I can see: a. check floating point style - with the dubious thing that some threshold has to be picked and given that everything is anyway within the unit sphere and all that, values can be small to start with (this is the reason I didn't do this in the first place) b. leave the strict check as it is - with the dubious result that as it can be seen, it's of very little use in practice c. ditch the check entirely and just mirror ALL points anyway - with the risk of introducing duplicates that will be nevertheless the first to vanish at collapsing time d. check based on point id aka not mirror the 3 points used for finding plane 1 and then the 2 furthest apart that are known to be in plane 2 (plane 2 is based on those 2 points and the normal to plane1, so not a third point as such).

    Do you want me to regenerate the pics in this article for the fixed values?

  9. Nah, don't regenerate anything, just do gen5 with fixed mirroring.

    And good thing we found it!

  10. Ps. Re > What would be preferable to do about mirroring the points in the plane?

    Imo d is the right answer, why bother checking for something you don't really care about ? You know which points are actually on the plane, let it rest at that, otherwise it's just more code for no purpose.

  11. Diana Coman says:

    Alright, I'll move on to implementing the new stuff for the next generation.

    Re points in the plane - because there can equally well be others too and the added code is the check itself - ie if you go for no added code, the straightforward solution is to just mirror *all* and then they'll get settled at collapsing time anyway. But I don't think it's a big issue in any case so d it will be.

  12. Diana Coman says:

    As part of the code refactoring and various tidy ups + further digs to prepare the whole orchestra for the latest changes, I got also at least *one* data point re limits of CS/Cal3d: unsurprisingly perhaps, it seems easier to overwhelm it via too fine polygonizations than in any other way - a mesh with ~7.3k vertices and 14.3k triangles, set on a skeleton with as few as 29 bones rendered fine (and even rather nicely) BUT with visible delay even as one just moved about to see it from different angles (i.e. it effectively slowed down character's movement just for being in its view radius, huh). That does mean though 14.3k*29=414.7k faces to render, each with their own normal.

    Talking of mesh generation, I further realised that the chaos I got into that poor mesh generator trying to make something interesting out of such a bland thing as a rounded cylinder is way, way too much for what the current tame polygonizer is in fact made to handle - though I realised it only now, I have been badly abusing the polygonizer to the point that the poor thing could easily end up with different results, it's a whole story. Anyways, for now I toned the chaos to more controlled levels, so the outcome is at least, ahem, deterministic, since otherwise there's not all that much point to go with it. There's still enough deformation in there anyway, there are still the 2 distinct types of meshes (cylinder-based vs egg-based) but the cylinder-based shape is not exactly what has been used in the previous parades.

Leave a Reply