Calculate depth of indentation in an model using three point system?

后端 未结 2 1652
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-29 05:16

Via Raycasting one can select a point on an GameObjects Collider. In the short visual three points are represented with small spheres denoting user selection. The desire is to c

2条回答
  •  后悔当初
    2021-01-29 05:43

    To complement Ruzihm's answer, as I pointed in the previous question you really need 4 (3+1) points. 3 (2+1) points are still not enough. Going back to my previous example assume that one point on the surface plane a is A is (0,0,0), another B is (0,0,1), and the point on the indentation plane b is I is (2,1,0). How deep is the indentation? The answer is: you still don't know. Adding the point B still left valid two choices from that example:

    • a is X = 0 while b is X = 2. Then the indentation depth is clearly 2.
    • a is Y = 0 while b is Y = 1. Then the indentation depth is clearly 1.

    And there are still infinitely many other options.

    This happens because two points (A and B) only fix a line rather than whole plane. To fix a plane you really need 3 points (not lying on the same line). And this is what Ruzihm's answers does.

提交回复
热议问题