Hello!!!
I’m using VTK 9.5.0 and trying to modify the position of points in the glsl vertex shader.
I’ve noticed that in some cases (not all), the vertex locations passed to the vertex shader by VTK are scaled/shifted relative to the point locations defined in the geometry datasets.
So I have two questions,
- Is the assumption above about VTK modifying the coordinates before passing to the vrtex shader correct?
- If so, how can I get hold of the transformation matrix so that I can account for this shift/scale before applyting the vertex updates in my shader?
The relevant part of my vertex shader looks something like this
"int vertexIndex = gl_VertexID;\n"
" vec4 deformed_pos = vertexMC + deformations[vertexIndex]*1000.;\n"
" vertexVCVSOutput = MCVCMatrix * deformed_pos;\n"
" gl_Position = MCDCMatrix * deformed_pos;\n"
It works just fine when the model is small and close to the orgin, but messes up in other cases….