I have been writing custom interactor code and have used vtk observers in a .net application to attempt to customize camera movement.
I have achieved everything I need except acquiring a vtkCamera. When I call GetCurrentRenderer from the vtkInteractorStyle of the vtkFormsWindowControl I get an application exception
"An unhandled exception of type 'System.ApplicationException' occurred in vtkCommonDotNet.dll
Additional information: Could not create class vtkRenderer from null native pointer.".
Does anyone know how to access the renderer of the vtkFormsWindowControl?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have done this and thank you for reminding me. I was attempting to extract the camera through the vtkInteractorStyle. This apparently does not work but I will attempt to get the renderer from the render window rather than the interactor.
Thank you for kick starting my brain. I will post my results after testing.
Ryan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have been writing custom interactor code and have used vtk observers in a .net application to attempt to customize camera movement.
I have achieved everything I need except acquiring a vtkCamera. When I call GetCurrentRenderer from the vtkInteractorStyle of the vtkFormsWindowControl I get an application exception
"An unhandled exception of type 'System.ApplicationException' occurred in vtkCommonDotNet.dll
Additional information: Could not create class vtkRenderer from null native pointer.".
Does anyone know how to access the renderer of the vtkFormsWindowControl?
Hi,
did you first add a "new" renderer to the vtkFormsWindowControl.GetRenderWindow?
vtkFormsWindowControl.GetRenderWindow.AddRenderer(new vtkRenderer)
I have done this and thank you for reminding me. I was attempting to extract the camera through the vtkInteractorStyle. This apparently does not work but I will attempt to get the renderer from the render window rather than the interactor.
Thank you for kick starting my brain. I will post my results after testing.
Ryan