【发布时间】:2022-01-15 11:07:32
【问题描述】:
我正在尝试在 google colab 中使用 Three.js 的 TensorflowGraphics 实现将图像应用到网格,但是当我尝试加载图像时它可以处理修改颜色,但它不起作用而且我不是确定出了什么问题。
代码如下:
context = threejs_visualization.build_context()
default_material = context.THREE.MeshPhongMaterial.new_object({
'map':context.THREE.ImageUtils.loadTexture(samplesfn + "missing_tex.png")
})
default_material['vertexColors'] = context.THREE.NoColors
mesh["material"] = default_material
_ = threejs_visualization.triangular_mesh_renderer(mesh, width=100, height=100)
threejs_visualization.triangular_mesh_renderer 提供于https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/notebooks/threejs_visualization.py
我知道问题不在于图像无法正确加载,因为在同一个文件中 openCV 可以加载它。
非常感谢任何帮助。
【问题讨论】:
标签: three.js google-colaboratory