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

Voerman, L. l.voerman at rug.nl
Wed Jan 15 04:00:28 PST 2020


Hi Tom,
Your model works with texture for me, in osg 3.4.0 as well as 3.6.5 with
the following commands:
sed -E "s#(f [0-9]+/[0-9]+)/0 ([0-9]+/[0-9]+)/0 ([0-9]+/[0-9]+)/0#\1 \2
\3#" "Data2.obj" > noNormals.obj
osgviewer -O noRotation  noNormals.obj
Laurens.


On Wed, Jan 15, 2020 at 12:24 PM 'Tom Pollok' via OpenSceneGraph Users <
osg-users at googlegroups.com> wrote:

> 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);
>
>
> Best,
> Tom
>
>
> 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> 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
> <https://groups.google.com/d/msgid/osg-users/b55a82c5-4801-49da-b1c4-149d868bd6fa%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>

-- 
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/CAG7xrZcHpJJa0N22kUaEw6vzJ5WRrG6YjGanvRB45Y-d9-fjfA%40mail.gmail.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200115/0b29c70c/attachment-0002.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/0b29c70c/attachment-0002.png>


More information about the osg-users mailing list