(self, mesh_verts, mesh_uv, mesh_faces, mesh_v_tangents, mesh_v_bitangents, mesh_v_normals)
| 63 | |
| 64 | |
| 65 | def compute_tbn(self, mesh_verts, mesh_uv, mesh_faces, mesh_v_tangents, mesh_v_bitangents, mesh_v_normals): |
| 66 | mesh_faces=mesh_faces.astype(np.int32) |
| 67 | closest_points, barys, vertex_idxs, face_idxs=closest_point_barycentrics(self.root_position, mesh_verts, mesh_faces) |
| 68 | |
| 69 | root_tangent, root_bitangent, root_normal = interpolate_tbn(barys, vertex_idxs, mesh_v_tangents, mesh_v_bitangents, mesh_v_normals) |
| 70 | #replace the normals because it's smoother |
| 71 | self.root_normal=root_normal |
| 72 | tbn = np.stack((root_tangent,root_bitangent,root_normal),axis=2) |
| 73 | self.tbn=tbn |
| 74 | # print("tbn", tbn.shape) |
| 75 | |
| 76 | |
| 77 |
no test coverage detected