Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camera control #194

Closed
fcollman opened this issue Aug 19, 2019 · 6 comments
Closed

camera control #194

fcollman opened this issue Aug 19, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@fcollman
Copy link

could you point me to where you would control the camera position programatically on these widgets? i have very large meshes and would like to point the camera at parts of them with code..

@thewtex
Copy link
Member

thewtex commented Aug 27, 2019

This has not been implemented yet, but we should ;-).

We could represent this as a camera traitlet on the Viewer class with content:

[[position_x, position_y, position_z],
 [focal_point_x, focal_point_y, focal_point_z],
 [view_up_x, view_up_y, view_up_z]]

and provide convenience methods, roll, azimuth, yaw, elevation, pitch on the Viewer.

@romangrothausmann @banesullivan @jourdain thoughts?

@thewtex thewtex added the enhancement New feature or request label Aug 27, 2019
@fcollman
Copy link
Author

Can I also suggest a setter method for taking a vtkCamera..

I have a lot of vtk code already that id just like to be able to use in a notebook where I can't have x windows.

@thewtex
Copy link
Member

thewtex commented Aug 27, 2019

Can I also suggest a setter method for taking a vtkCamera..

👍 good idea.

We can support:

viewer.camera = vtk_camera_instance

@banesullivan
Copy link

I really like the sugesstions so far!

We could represent this as a camera traitlet on the Viewer class with content:

[[position_x, position_y, position_z],
 [focal_point_x, focal_point_y, focal_point_z],
 [view_up_x, view_up_y, view_up_z]]

This is perfectly in line with how we handle the camera in PyVista! (pyvista.Plotter.camera_position)

and provide convenience methods, roll, azimuth, yaw, elevation, pitch on the Viewer.

This seems to be something that would come after #166/#179 where the Viewer class is able to be instantiated, have data added to the scene, the camera position set, then shown - much like how PyVista Plotters are used.

@thewtex
Copy link
Member

thewtex commented Sep 9, 2019

An initial implementation was added in #202 .

Still todo:

  • Support setting with a vtkCamera instance
  • Add the convenience methods for manipulating the camera

@thewtex
Copy link
Member

thewtex commented Jul 30, 2020

vtkCamera support added in #369

@thewtex thewtex added this to the itkwidgets 0.33 Beta 2 milestone Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants