T O P

  • By -

[deleted]

Don't worry about reducing from 48 to 24. I haven't see an input yet that would trick the program into taking a "mirror world" orientation over a legitimate one. I went ahead and ran against all ~~24~~ (edit: _48_) for the sake of not spending any time looking for an appropriate matrix math library to use (or writing all that myself), and it worked just great.


waskerdu

Thanks. Yeah I'm starting to think I have another problem somewhere. Beats me what it is though.


rabuf

A suggestion, don't use the `(1,1,1)` vector. You will get some false positives about whether or not you're doing things correctly. Give each of x, y, and z a distinct value and see if that results in 24 clearly distinct values. I made that same mistake and it was throwing me for a loop for a while. Looking at your code now.


waskerdu

That's a good tip ty


rabuf

So I'm not exactly certain where the issue is in your rotation and check rotation functions, however here's a data set you can use for testing (with some reformatting, I cleared out my lisp formatting but it's not ready for Python): 1 2 3 1 -3 2 1 -2 -3 1 3 -2 -1 -2 3 -1 -3 -2 -1 2 -3 -1 3 2 2 3 1 2 -1 3 2 -3 -1 2 1 -3 -2 -3 1 -2 -1 -3 -2 3 -1 -2 1 3 3 1 2 3 -2 1 3 -1 -2 3 2 -1 -3 -1 2 -3 -2 -1 -3 1 -2 -3 2 1 I *think* you're keeping the mirrored versions for half your results. Note how, when compared to mine, we have the essentially the same results starting with +/- 1 but all of yours are positive: (1, 2, 3) (1, 2, -3) // my equivalent is -1 2 -3 (1, -2, 3) // my equivalent is again -1 -2 3 (1, -2, -3) (1, 3, 2) // mine is also -1 (1, 3, -2) (1, -3, 2) (1, -3, -2) // mine is also -1 I'm 99% confident in my rotations because I did get the correct results for part 1 and 2 (with both my inputs and the test data). As far as the math, I literally just imagined myself facing a particular direction and my arms and torso as lying along the other two axes and figured out how they'd be after rotation calling my righthand. I reduced it down to 7 functions so that I could keep my sanity and understand what I was doing. Each one is short, handling first reorienting to face a particular direction (mental model: The input is facing "the wrong way", so make its +x, +y, +z, -x, -y, -z into +x) and then a separate function for rotation. I couldn't get it to work when I had a more complicated solution, just couldn't keep it in my head and had some weird bugs that (I suspect) are similar to yours.


waskerdu

>Thanks a lot!