MCPcopy Create free account
hub / github.com/Kitware/VTK / SetCameraFromDeviceToWorldMatrix

Method SetCameraFromDeviceToWorldMatrix

Rendering/VR/vtkVRCamera.cxx:152–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void vtkVRCamera::SetCameraFromDeviceToWorldMatrix(vtkMatrix4x4* mat, double distance)
153{
154 double* ele = mat->GetData();
155
156 // position is the last column of the matrix
157 this->SetPosition(ele[3], ele[7], ele[11]);
158
159 // view up is the second column of the matrix
160 this->SetViewUp(ele[1], ele[5], ele[9]);
161
162 // direction of projection is the third column of the matrix
163 // but we set it by setting the focal point
164 this->SetFocalPoint(
165 ele[3] - distance * ele[2], ele[7] - distance * ele[6], ele[11] - distance * ele[10]);
166}
167VTK_ABI_NAMESPACE_END

Callers 3

UpdateHMDMatrixPoseMethod · 0.80
UpdateHMDMatrixPoseMethod · 0.80

Calls 4

SetViewUpMethod · 0.80
GetDataMethod · 0.45
SetPositionMethod · 0.45
SetFocalPointMethod · 0.45

Tested by

no test coverage detected