MCPcopy Create free account
hub / github.com/city-super/Octree-GS / lookAt

Function lookAt

SIBR_viewers/src/core/system/Matrix.cpp:96–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 }
95
96 Matrix4f lookAt(
97 const Vector3f& eye,
98 const Vector3f& center,
99 const Vector3f& up )
100 {
101 const sibr::Vector3f f = (center - eye).normalized();
102 sibr::Vector3f u = up.normalized();
103 const sibr::Vector3f s = f.cross(u).normalized();
104 u = s.cross(f);
105
106 Eigen::Matrix<float, 4, 4, 0, 4, 4> res;
107 res << s.x(),s.y(),s.z(),-s.dot(eye),
108 u.x(),u.y(),u.z(),-u.dot(eye),
109 -f.x(),-f.y(),-f.z(),f.dot(eye),
110 0,0,0,1;
111
112 return res;
113 }
114
115 void operator<< (std::ofstream& outfile, const Matrix4f& m)
116 {

Callers 2

snapMethod · 0.85
parseTransformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected