[Development] Adding .mtl files into qt3d+qt5.5 based applcation

Sean Harmer sean.harmer at kdab.com
Wed Mar 18 10:06:05 CET 2015


Hi,

On Wednesday 18 Mar 2015 08:33:07 Arjun Das wrote:
> Hi,
> 
> When i export "blender" files into .obj files, i get .mtl supporting files
> as well. However, I am able to add .obj files but am not sure how to add
> the .mtl file information.

At present Qt3D 2 does not support mtl files referenced by obj files. You 
would need to specify these material and texture properties manually within 
QML for now. The examples that ship with Qt3D show how to do this (e.g. using 
PhongMaterial{}). If you would like to see this feature supported, please file 
a JIRA task at bugreports.qt.io.

It's not trivial as there are many ways to map the vertex data and texture 
data into OpenGL. For example you could use a separate glDrawElements() call  
for each object within the obj file and set a different texture for each face. 
Or you could put all textures into an array texture and the material 
properties into a uniform buffer object and index into them using an 
additional per vertex attribute. The second option is more efficient but not 
all hardware supports these features.

> Additionally, are there any documentation for qt3d 2.0 (5.5 branch) ? I am
> trying to understand the APIs from the example. Any extra help would be
> great.

The documentation is still in the early stages as some parts of the API are 
still in flux. For now the best bet is to look at the examples or poke people 
on the #qt-3d irc channel. You may also be able to get some tips from the blog 
series at http://www.kdab.com/category/blogs/qt3d/

Of course also feel free to ask on the interest@ mailing list.

Cheers,

Sean
-- 
Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
KDAB (UK) Ltd, a KDAB Group company
Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
Mobile: +44 (0)7545 140604
KDAB - Qt Experts



More information about the Development mailing list