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 use it in realtime scenario not offline? #2

Open
lucasjinreal opened this issue Feb 6, 2022 · 1 comment
Open

how to use it in realtime scenario not offline? #2

lucasjinreal opened this issue Feb 6, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@lucasjinreal
Copy link

Hi, how to use it visualize human mesh regressed from SMPL realtime? Something just like opencv imshow in waitKey(0). It just show frame by frame with fastest render speed.

Does this lib can support this?

@cansik cansik self-assigned this Feb 6, 2022
@cansik cansik added enhancement New feature or request question Further information is requested labels Feb 6, 2022
@cansik
Copy link
Owner

cansik commented Feb 6, 2022

Currently this is meant to playback a sequence of already exiting meshes, not like imshow by opencv. But it would be possible I guess, here an example which displays a torus or box (alternating):

import time
import open3d as o3d

from mesh_sequence_player.MeshSequencePlayer import MeshSequencePlayer


def mesh_show(player: MeshSequencePlayer, geometry: o3d.geometry.Geometry3D, wait_time: float = 0.0):
    player.vis.clear_geometries()
    player.vis.add_geometry(geometry, reset_bounding_box=True)

    t = time.time()
    while time.time() - t < wait_time:
        player.vis.poll_events()
        time.sleep(0.01)


def main():
    player = MeshSequencePlayer()
    player.open()

    torus = o3d.geometry.TriangleMesh.create_torus()
    box = o3d.geometry.TriangleMesh.create_box()

    for i in range(20):
        geometry = torus if i % 2 == 0 else box
        mesh_show(player, geometry, 0.2)

    player.close()


if __name__ == "__main__":
    main()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants