[Python] Is there a way to get set_environment_texture to work with streamlit stpyvista

Discussão em 'Python' iniciado por Stack, Outubro 3, 2024.

  1. Stack

    Stack Membro Participativo

    I have this code and it works when I run it with pyvista but with stpyvista the cubemap does not show up and it has a white background This is what it looks like when I run it with stpyvista and This is what it looks like with pyvista

    light = pv.Light()
    light.set_direction_angle(30, -20)

    mars = examples.planets.load_mars(radius=3397.2)
    mars_texture = examples.planets.download_mars_surface(texture=True)
    mars.translate((-30000.0, 0.0, 0.0), inplace=True)

    plotter = pv.Plotter(lighting="none")

    cubemap = examples.download_cubemap_space_16k()
    _ = plotter.add_actor(cubemap.to_skybox())
    plotter.set_environment_texture(cubemap, True)
    plotter.add_light(light)
    plotter.add_mesh(mars, texture=mars_texture, smooth_shading=True)
    plotter.view_isometric()

    stpyvista(plotter)

    Continue reading...

Compartilhe esta Página