MCPcopy Create free account
hub / github.com/city-super/Scaffold-GS / alignRotationMatrix

Function alignRotationMatrix

SIBR_viewers/src/core/system/Vector.cpp:28–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 }
27
28 Eigen::Matrix<float, 4, 4, Eigen::DontAlign> alignRotationMatrix(const sibr::Vector3f & from, const sibr::Vector3f & to)
29 {
30 sibr::Quaternionf q = sibr::Quaternionf::FromTwoVectors(from, to);
31 q.normalize();
32 Eigen::Matrix3f R = q.toRotationMatrix();
33 sibr::Matrix4f R4;
34 R4.setIdentity();
35 R4.block<3, 3>(0, 0) = R;
36 return R4;
37 }
38
39} // namespace sibr

Callers

nothing calls this directly

Calls 1

normalizeMethod · 0.80

Tested by

no test coverage detected