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 to open a new window when clicking on a mesh in Open3D #6823

Open
3 tasks done
dangmanhtruong1995 opened this issue Jun 10, 2024 · 0 comments
Open
3 tasks done

How to open a new window when clicking on a mesh in Open3D #6823

dangmanhtruong1995 opened this issue Jun 10, 2024 · 0 comments
Labels

Comments

@dangmanhtruong1995
Copy link

Checklist

My Question

Hi everyone, I would like to ask a question. So i have some mesh which I have created using the Visualizer, now how can I open a new window when I click on that mesh ? Because it seems that the examples talk about clicking on some Button and not in the Visualizer. Below I have attached some code. Thank you very much.

import numpy as np
import open3d as o3d

def main():
    mesh = o3d.io.read_triangle_mesh(o3d.data.BunnyMesh().path)
    pcd1 = mesh.sample_points_poisson_disk(10000)

    visualizer = o3d.visualization.Visualizer()
    visualizer.create_window()

    visualizer.add_geometry(pcd1)

    # mesh = convert_image_to_mesh(img)
    # mesh.scale(scale=0.1, center=pcd1.get_center())
    # visualizer.add_geometry(mesh)

    # Show xyz axes
    rendering_options = visualizer.get_render_option()
    rendering_options.show_coordinate_frame = True
    rendering_options.background_color = np.asarray([0.5, 0.5, 0.5])

    mesh = o3d.geometry.TriangleMesh.create_sphere(radius=0.1)
    mesh.scale(scale=0.3, center=mesh.get_center())

    visualizer.add_geometry(mesh)

    visualizer.run()

if __name__ == "__main__":
    main()
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

1 participant