Hey all, I am trying to do some renderings with VTK to compare VTK Python and Paraview.
As of right now my understanding of ParaViews use of VTK is that it uses vtkPolyDataFS.glsl which contains an empty shader files with pre-defined tags from vtkOpenGLPolyDataMapper.cxx.
In ParaView, there is a replacement shaders tab and what I am doing is replacing “//VTK::Light::Impl” with this:
vec3 n = (normalVCVSOutput + 1.0) * 0.5;
gl_FragData[0] = vec4(n.x,0.0,0.0,1.0);
This works just fine, I am trying to replicate making this with VTK outside of ParaView (on VSCode). How would I do this? I know I have to get the current view coordinates so I tried using
def camera_callback(obj, event):
camera = obj.GetActiveCamera()
position = camera.GetPosition()
print("Camera Position:", position)
iren.AddObserver(vtk.vtkCommand.ModifiedEvent, camera_callback)
coordinate = vtk.vtkCoordinate()
coordinate.SetCoordinateSystemToWorld()
coordinate.SetValue(0, 0, 0)
print("World Coordinate:", coordinate.GetComputedWorldValue(ren))
However this did not work. Any resources would be more than helpful.