[PyQt] Ambient texture map

Paul pyqt at paulkoppen.com
Mon Jan 23 22:09:35 GMT 2017


Hello,

I have an object in .obj format with a .mtl which defines an ambient 
texture map using map_Ka. Could it be that Qt3D does not support ambient 
texture maps?

My Python code looks something like this:

#-----
app  = QGuiApplication([])
view = Qt3DWindow()
sceneRoot = QEntity()

# Scene camera.
basicCamera = view.camera()
basicCamera.set...

# Load scene.
scl = QSceneLoader(sceneRoot)
scl.setSource(QUrl.fromLocalFile('10097.obj'))
sceneRoot.addComponent(scl)

view.setRootEntity(sceneRoot)
view.show()

app.exec()
#-----

But the object renders near black (screenshot attached). Only texture 
seems to come from diffuse light (with a default light set up 
somewhere?). I am looking for a way to see the mesh without light in the 
scene.

I found this page listing all sorts of materials 
(https://doc-snapshots.qt.io/qt5-5.6/qt3drender-qmaterial.html) but 
ambient is always QColor rather than QAbstractTextureProvider.

Any help greatly appreciated.

Regards,
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pyqt-qt3d-render-black.png
Type: image/png
Size: 51859 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170123/509dc075/attachment-0001.png>


More information about the PyQt mailing list