Is there a way to create Qt3DRender.QTextureImage
from QImage
?
My goal is to place a custom image on a plane in a 3D space.
I only know that QTextureImage
can open some raster image files (e.g. .webp) and files such as .jpg.
It can open file from a disk:
material = Qt3DExtras.QNormalDiffuseSpecularMapMaterial()
material.setTextureScale(1)
material.setAmbient(QColor.fromRgbF(1, 1, 1, 0))
image = Qt3DRender.QTextureImage()
image.setSource(QUrl("file:test.jpg"))
material.normal().addTextureImage(image)
plane_entity.addComponent(material)
I want to do something like this:
image.setSource(QImage())