[osg-users] Loading textured meshes (obj+mtl) leads to crash in osg 3.4.1

'Tom Pollok' via OpenSceneGraph Users osg-users at googlegroups.com
Wed Jan 15 03:24:32 PST 2020

Hello Robert,

to test it with my old osg version, i fixed the obj file such it does not 
contain any indices to normals anymore, as there are no normals.
This indeed helped loading the model, but no textures appear at all. Should 
it load the textures automatically due to the first line in the obj file 
being mtllib Data.mtl and the use of usemtl material_0 before the faces or 
do i need to take extra care when loading a textured model?

For loading, im using only:

osgDB::Options* opt = new osgDB::Options;opt->setOptionString("noRotation");osg::ref_ptr<osg::Node> node = osgDB::readNodeFile(pathToObjFile, opt);


Am Dienstag, 14. Januar 2020 17:25:27 UTC+1 schrieb Robert Osfield:
> On Tue, 14 Jan 2020 at 15:26, 'Tom Pollok' via OpenSceneGraph Users <
> osg-... at googlegroups.com <javascript:>> wrote:
>> Thank you for the workaround.
>> So as far as i understand you only add the texture coordinate and normal, 
>> if there exists one with a index greater than 0 and less then the number of 
>> normals or texture coordinates.
>> So that means that openscenegraph now will be able to display the 
>> textured mesh, even if the normals are missing, right?
> Yes, that's correct, you'll get a textured mesh with no normals assigned.
> Robert.

You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/b55a82c5-4801-49da-b1c4-149d868bd6fa%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200115/aa20284c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Auto Generated Inline Image 1
Type: image/png
Size: 36871 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200115/aa20284c/attachment.png>

More information about the osg-users mailing list