Find the normal angle of the face of a triangle in 3D, given the co-ordinates of its vertices

后端 未结 4 1951
暗喜
暗喜 2021-02-02 16:30

As you may be able to tell from this screenshot, I am trying to make a physics engine for a platformer I am working on, but I have run into a definite problem: I need to be able

4条回答
  •  迷失自我
    2021-02-02 17:07

    There are 2 normals to the triangle (of course) and the one you get from standard algorithms depends on the order of ther vertices. Quoting wiki

    "For a polygon (such as a triangle), a surface normal can be calculated as the vector cross product of two (non-parallel) edges of the polygon."

    But the direction of the normal depends on the order of points chosen, you can calculate it and decide using some other heuristics whether the reverse vector is the normal you are interested in.

提交回复
热议问题