MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / compute_tbn

Method compute_tbn

data_loader/dataloader.py:65–74  ·  view source on GitHub ↗
(self, mesh_verts, mesh_uv, mesh_faces, mesh_v_tangents, mesh_v_bitangents, mesh_v_normals)

Source from the content-addressed store, hash-verified

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

Callers 1

__init__Method · 0.95

Calls 2

interpolate_tbnFunction · 0.85

Tested by

no test coverage detected