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

Method SetMatrices

Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx:112–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112void 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
145void vtkOpenGLContextDevice3D::BuildVBO(vtkOpenGLHelper* cellBO, const float* f, int nv,
146 const unsigned char* colors, int nc, float* tcoords)

Callers 4

DrawPolyMethod · 0.95
DrawLinesMethod · 0.95
DrawPointsMethod · 0.95
DrawTriangleMeshMethod · 0.95

Calls 10

vtkglDisableMethod · 0.80
GetProjectionMatrixMethod · 0.80
GetModelMatrixMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
GetStateMethod · 0.45
SetUniformMatrixMethod · 0.45
GetMatrixMethod · 0.45
SetUniformiMethod · 0.45
SetUniform4fvMethod · 0.45

Tested by

no test coverage detected