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

How do I use the view control? #6121

Open
3 tasks done
simhue opened this issue Apr 27, 2023 · 1 comment
Open
3 tasks done

How do I use the view control? #6121

simhue opened this issue Apr 27, 2023 · 1 comment
Labels

Comments

@simhue
Copy link

simhue commented Apr 27, 2023

Checklist

My Question

Hi,

I am currently trying to position the camera of the Visualizer at a specific point, but every value I set up will be ignored and the visualizer always displays the same view of my mesh.

This is my code so far:

vis = o3d.visualization.Visualizer()

vis.create_window()
vis.add_geometry(pcb_mesh)

option: o3d.visualization.RenderOption = vis.get_render_option()
option.show_coordinate_frame = True
option.mesh_show_back_face = True
option.light_on = False

view_control: o3d.visualization.ViewControl = vis.get_view_control()
view_control.set_front([ -0.16369650945088704, 0.0082033463888920785, -0.98647663829490639 ])
view_control.set_lookat([ -0.5126953125, 0.0146484375, 1.3552540928219587 ])
view_control.set_up([ -0.14927274718300235, 0.98824562139584249, 0.032988463746963764 ])
view_control.set_zoom(0.7)

vis.update_geometry(pcb_mesh)
vis.poll_events()
vis.update_renderer()

image = vis.capture_screen_float_buffer()
vis.destroy_window()

I also tried

cam = view_control.convert_to_pinhole_camera_parameters()
cam.extrinsic = ...
cam = view_control.convert_from_pinhole_camera_parameters(cam)

But this also has no effect.

I am using Open3D v0.17.0, but I also tried downgrading to 0.16 and 0.15.

Am I missing something here?

@cwreynolds
Copy link

Thanks. This is a known bug (#6009) in the 0.17.0 release, for which a fix was recently proposed (#6116).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants