python - 在 VisPy 中显示旋转立方体表面的图像

标签 python 3d visualization data-visualization vispy

我玩过this example的 VisPy 来显示一个旋转的立方体。有没有办法加载图像(例如 png)并将其显示为立方体的一个面?

最佳答案

您可以使用 imageio 读取图像数据(通过 pip install imageio 获取),然后将其用作纹理:

import imageio
im = imageio.imread('/path/to/image.png')
texture.set_data(im)  # use image as texture

奖励积分,在立方体上展示视频:

reader = imageio.read('/path/to/movie.mp4')
# somwhere in a timer callback
texture.set_data(reader.get_next_data())

关于python - 在 VisPy 中显示旋转立方体表面的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26351125/

相关文章:

python - pandas 在非字母表的任何字符上分割字符串列

3d - 如何将非网格3D数据描绘为热图?

algorithm - 任何渲染多个实体切割平面的方法?

apache - 如何以图形方式表示和操作 apache avro 架构

java - 在处理层映射 GPS 点

python - 根据满足所有行的条件增加几行的值

python - 3d 矩阵中的 2d bool 选择

graphics - 四元数和球面旋转坐标之间的正确转换?

javascript - 缩放 d 3's histogram x domain causes "<rect> 属性的负值无效”错误

python - matplotlib旋转后的新线坐标点