| 150 | } |
| 151 | |
| 152 | void 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 | } |
| 167 | VTK_ABI_NAMESPACE_END |
no test coverage detected