------------------------------------------------------------------------------ The orthographic perspective maps [xmin,xmax], [ymin,ymax], [-znear,-zfar] to [-1,+1], [-1,+1], [-1,+1]. From the OpenGL Programmer's guide, 2nd Ed.
| 248 | // to [-1,+1], [-1,+1], [-1,+1]. |
| 249 | // From the OpenGL Programmer's guide, 2nd Ed. |
| 250 | void vtkPerspectiveTransform::Ortho( |
| 251 | double xmin, double xmax, double ymin, double ymax, double znear, double zfar) |
| 252 | { |
| 253 | double matrix[4][4]; |
| 254 | vtkMatrix4x4::Identity(*matrix); |
| 255 | |
| 256 | matrix[0][0] = 2 / (xmax - xmin); |
| 257 | matrix[1][1] = 2 / (ymax - ymin); |
| 258 | matrix[2][2] = -2 / (zfar - znear); |
| 259 | |
| 260 | matrix[0][3] = -(xmin + xmax) / (xmax - xmin); |
| 261 | matrix[1][3] = -(ymin + ymax) / (ymax - ymin); |
| 262 | matrix[2][3] = -(znear + zfar) / (zfar - znear); |
| 263 | |
| 264 | this->Concatenate(*matrix); |
| 265 | } |
| 266 | |
| 267 | //------------------------------------------------------------------------------ |
| 268 | // The frustum perspective maps a frustum with the front plane at -znear |
no test coverage detected