------------------------------------------------------------------------------ Utility for adjusting the min/max range of the Z buffer. Usually the oldZMin, oldZMax are [-1,+1] as per Ortho and Frustum, and you are mapping the Z buffer to a new range.
| 232 | // the oldZMin, oldZMax are [-1,+1] as per Ortho and Frustum, and |
| 233 | // you are mapping the Z buffer to a new range. |
| 234 | void vtkPerspectiveTransform::AdjustZBuffer( |
| 235 | double oldZMin, double oldZMax, double newZMin, double newZMax) |
| 236 | { |
| 237 | double matrix[4][4]; |
| 238 | vtkMatrix4x4::Identity(*matrix); |
| 239 | |
| 240 | matrix[2][2] = (newZMax - newZMin) / (oldZMax - oldZMin); |
| 241 | matrix[2][3] = (newZMin * oldZMax - newZMax * oldZMin) / (oldZMax - oldZMin); |
| 242 | |
| 243 | this->Concatenate(*matrix); |
| 244 | } |
| 245 | |
| 246 | //------------------------------------------------------------------------------ |
| 247 | // The orthographic perspective maps [xmin,xmax], [ymin,ymax], [-znear,-zfar] |
no test coverage detected