VTK draw-camera

I am trying to create a drawing scene using VTK modules. I have created axes and grid planes with a minimum point of (0.0,0.0,0.0) and a maximum point of (10.0,10.0,10.0). By resetting the camera, the user appears to be drawing inside the grid plane; however, the focal point of the camera is set by default to (5.0,5.0,5.0). As a result, the user cannot zoom in and draw in the space between (0.0,0.0,0.0) and (5.0,5.0,5.0).

If I manually set up the camera’s position and clipping range, the user is able to zoom, but the drawing experience is not ideal. Specifically, it seems that while the lines are drawn within the grid planes, they ultimately appear to be drawn outside the intended drawing space.

Do you have any suggestions to enhance the drawing experience and resolve these issues?

Hello,

I believe illustrating the issue with a figure would help. Experience is subjective.

best,

PC

Hi Paulo, thank you for your response.

I’ve added some captures to better figure out the problem I’m facing. In the first capture, the camera is reset, and the user can draw lines effectively within the grid space. However, because the focal point is set by default at the center of the grid, zooming or drawing lines near the center of the axes becomes not feasible or difficult. If the camera is not reset or manually configured (e.g., adjusting the focal point, clipping range, etc.), the user cannot draw lines within the grid space, as shown in the second video.

https://www.dropbox.com/scl/fi/85kyzvqeh3ilasdthf2ov/VTK_APP-VTK_APP1-2024-10-21-09-55-40.mp4?rlkey=lk2vd2awman56bu5g378fberm&st=5y6l7g0v&dl=0

https://www.dropbox.com/scl/fi/ba2b6wtf6cgpe1zjie0kj/VTK_APP-VTK_APP1-2024-10-21-09-53-46.mp4?rlkey=t9dege7ueqmx0tnuk7pil4mj8&st=9lzbo4l2&dl=0

Best regards,
GS

@Paulo_Carvalho
fyi
I solved the problem without modifying the camera at all. I just used the vtkCellPicker to get the world event coordinates and added a ‘fake’ vtkCubeSource with an opacity close to 0 (invisible) that covers the grid’s space. It is not the best solution, but now user is able to draw effectively inside the grid space.

1 Like