| 110 | } |
| 111 | |
| 112 | void vtkOpenGLContextDevice3D::SetMatrices(vtkShaderProgram* prog) |
| 113 | { |
| 114 | vtkOpenGLState* ostate = this->RenderWindow->GetState(); |
| 115 | ostate->vtkglDisable(GL_SCISSOR_TEST); |
| 116 | prog->SetUniformMatrix("WCDCMatrix", this->Device2D->GetProjectionMatrix()); |
| 117 | |
| 118 | vtkMatrix4x4* mvm = this->Device2D->GetModelMatrix(); |
| 119 | vtkMatrix4x4* tmp = vtkMatrix4x4::New(); |
| 120 | vtkMatrix4x4::Multiply4x4(mvm, this->ModelMatrix->GetMatrix(), tmp); |
| 121 | |
| 122 | prog->SetUniformMatrix("MCWCMatrix", |
| 123 | // this->ModelMatrix->GetMatrix()); |
| 124 | tmp); |
| 125 | tmp->Delete(); |
| 126 | |
| 127 | // add all the clipping planes |
| 128 | int numClipPlanes = 0; |
| 129 | float planeEquations[6][4]; |
| 130 | for (int i = 0; i < 6; i++) |
| 131 | { |
| 132 | if (this->ClippingPlaneStates[i]) |
| 133 | { |
| 134 | planeEquations[numClipPlanes][0] = this->ClippingPlaneValues[i * 4]; |
| 135 | planeEquations[numClipPlanes][1] = this->ClippingPlaneValues[i * 4 + 1]; |
| 136 | planeEquations[numClipPlanes][2] = this->ClippingPlaneValues[i * 4 + 2]; |
| 137 | planeEquations[numClipPlanes][3] = this->ClippingPlaneValues[i * 4 + 3]; |
| 138 | numClipPlanes++; |
| 139 | } |
| 140 | } |
| 141 | prog->SetUniformi("numClipPlanes", numClipPlanes); |
| 142 | prog->SetUniform4fv("clipPlanes", 6, planeEquations); |
| 143 | } |
| 144 | |
| 145 | void vtkOpenGLContextDevice3D::BuildVBO(vtkOpenGLHelper* cellBO, const float* f, int nv, |
| 146 | const unsigned char* colors, int nc, float* tcoords) |
no test coverage detected