MCPcopy Create free account
hub / github.com/OpenMeshLab/MeshXL / rotation

Function rotation

utils/ply_helper.py:60–78  ·  view source on GitHub ↗
(axis, angle)

Source from the content-addressed store, hash-verified

58 return math.sqrt(vec3[0]*vec3[0] + vec3[1]*vec3[1] + vec3[2]*vec3[2])
59
60 def rotation(axis, angle):
61 rot = np.eye(4)
62 c = np.cos(-angle)
63 s = np.sin(-angle)
64 t = 1.0 - c
65 axis /= compute_length_vec3(axis)
66 x = axis[0]
67 y = axis[1]
68 z = axis[2]
69 rot[0,0] = 1 + t*(x*x-1)
70 rot[0,1] = z*s+t*x*y
71 rot[0,2] = -y*s+t*x*z
72 rot[1,0] = -z*s+t*x*y
73 rot[1,1] = 1+t*(y*y-1)
74 rot[1,2] = x*s+t*y*z
75 rot[2,0] = y*s+t*x*z
76 rot[2,1] = -x*s+t*y*z
77 rot[2,2] = 1+t*(z*z-1)
78 return rot
79
80
81 verts = []

Callers 1

create_cylinder_meshFunction · 0.85

Calls 1

compute_length_vec3Function · 0.85

Tested by

no test coverage detected