For a 3D game engine I’m working on I need to calculate if two 3D triangles are on the same plane to display it accordingly. How do I calculate the angles of a triangle in 3D space?
Would calculating a surface normal and comparing those ever give me 2 equivalent normals?
Why do you want to do that? What is the number of triangle you expect to test? It seems a little bit complex for a real time rendering algorithm!
Anyway:
Compute the normal
nof the triangle. Then compute the plane equation:a.x + b.y + c.z + d = 0with(a,b,c)being your triangle normal andd = - dot(n,P)(P is one of your triangle vertex). Do the same for the second triangle.The two planes are the same if the four values
abcdare equals or opposite (all together).