def get_proj_matrix(self, part, t, nose_y):
# a matrix to project verts
# into uv space for horizontal parts of this step
# so uv = (rM * vertex).to_2d()
tl = t - nose_y / self.get_length("LEFT")
tr = t - nose_y / self.get_length("RIGHT")
t2, part, dz, shape = self.get_part(tl, "LEFT")
p0 = part.lerp(t2)
t2, part, dz, shape = self.get_part(tr, "RIGHT")
p1 = part.lerp(t2)
v = (p1 - p0).normalized()
return Matrix([
[-v.y, v.x, 0, p0.x],
[v.x, v.y, 0, p0.y],
[0, 0, 1, 0],
[0, 0, 0, 1]
]).inverted()
评论列表
文章目录