isl-org / isl-org/Open3D

SceneWidget FLY view controls movement does not work

Open
#7,331 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

### Checklist

- [x] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [x] For Python issues, I have tested with the [latest development wheel](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [x] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).

### Describe the issue

The camera controls for the SceneWidget's FLY view control are non functional.
Specifically W,A,S,D do not have any effect on the cameras position.

### Steps to reproduce the bug

Run this on Windows using WSL
Full Source code:

```python
import open3d as o3d
import open3d.visualization.gui as gui
import open3d.visualization.rendering as rendering
print(o3d.__version__)
app = gui.Application.instance
app.initialize()

window = app.create_window("FLY Mode Test", 1024, 768)
scene_widget = gui.SceneWidget()
window.add_child(scene_widget)

scene_widget.scene = rendering.Open3DScene(window.renderer)
scene_widget.set_view_controls(gui.SceneWidget.Controls.FLY)
window.set_focus_widget(scene_widget)

def key_callback(event):
print(f"Key: {event.key}")
if event.key in [gui.KeyName.W, gui.KeyName.A, gui.KeyName.S, gui.KeyName.D]:
return gui.SceneWidget.EventCallbackResult.IGNORED
return gui.SceneWidget.EventCallbackResult.IGNORED

scene_widget.set_on_key(key_callback)

# Create and add a mesh
mesh = o3d.geometry.TriangleMesh.create_box()
mesh.compute_vertex_normals()
scene_widget.scene.add_geometry("box", mesh, rendering.MaterialRecord())

# Frame the camera to view the mesh
bounds = mesh.get_axis_aligned_bounding_box()
scene_widget.scene.camera.look_at(
bounds.get_center(),
bounds.get_center() + [0, 0, 3], # Camera position
[0, 1, 0] # Up direction
)

app.run()
```

### Error message

No error message, just notice the the camera does not move.

### Expected behavior

The Camera should move with the WASD movement

### Open3D, Python and System information

```markdown
- Operating system: Windows 10 64-bit --> WSL
- Python version: Python 3.12.3
- Open3D version: 0.19.0
- System architecture: x86
- Is this a remote workstation?: No
- How did you install Open3D: pip
- Compiler version (if built from source): N/A
```

### Additional information

The Mouse controls and E & D keys function properly

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.