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

Function perspectiveOffCenter

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

Source from the content-addressed store, hash-verified

35 }
36
37 Matrix4f perspectiveOffCenter(
38 float left, float right, float bottom, float top, float mynear, float myfar )
39 {
40 float x = (2.0f * mynear) / (right - left);
41 float y = (2.0f * mynear) / (top - bottom);
42 float a = (right + left) / (right - left);
43
44 float b = (top + bottom) / (top - bottom);
45 float c = -(myfar + mynear) / (myfar - mynear);
46 float d = -(2.0f * myfar * mynear) / (myfar - mynear);
47 float e = -1.0f;
48
49 Matrix4f m;
50
51 m <<
52 x, 0, 0, 0,
53 0, y, 0, 0,
54 a, b, c, e,
55 0, 0, d, 0;
56
57 return m;
58 }
59
60 Matrix4f perspectiveStereo(
61 float fovRadian, float aspect, float zn, float zf, float focalDistance, float eyeDistance, bool isLeftEye )

Callers 1

perspectiveStereoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected