[osg-users] [osgPlugins] Trouble with texture to export to OSGJS format

Jordi Torres jtorresfabra at gmail.com
Mon Jul 27 10:30:43 PDT 2015


Hi Mathieu,

You should use the gles plugin to export to avoid the Fatal nb colors error.
See: https://github.com/cedricpinson/osgjs/wiki/Convert-model-with-OSG.

For the images:

You can try to convert first your model to osgb and write the textures to
disk and then convert to osgjs using $osgconv file.osgb.gles file.osgjs, if
the osgjs plugin is not writting to disk the images.
Also you can save them as inline images in the same osgjs file. The
resultant file will be bigger though, but it is ok for quick tests. For
example drag & dropping here http://webkeux.com/osgjs-test/

One more thing, if you have the images as separate files you *must *use a
server (http server I mean).

Cheers.

2015-07-27 9:59 GMT+02:00 Mathieu Bartillat <mathieu.rougeron at telespazio.com
>:

> Good morning,
>
> I'm hardly trying to export a 3d model to OSGJS format but I have trouble
> with the textures. Concretely the textures do not appear in the OSGJS
> output file.
>
> What I did:
>
> 1) initially I had an IVE file that an infographist gave me. I tried the
> two commands osgconv File.ive File.osgjs.
> I got this return:
> Fatal nb colors 1 != 1349
> can't save osgjs file
> Unable to write to output stream
>
> Idem with osgconv -O OutputTextureFiles File.ive File.osgjs
>
> 2) I tried (just for test) to convert the ive file to osg format. It works
> but the output file has no texture.
>
> 3) I asked the infographist to export the model to OBJ format with 3dsMAX.
> So I got an OBJ file and a MTL file.
> Then I do osgconv -O OutputTextureFiles File.obj File.osgjs
> I get some warnings such as
>
> *** line not handled *** :map_refl
> C:\myFolder\myFolder2\maps\refmap_txt.jpg
> Warning: [ReaderWriterOBJ::convertElementListToGeometry] Some faces from
> geometry '' were reversed by the plugin
>
> Strange because the JPG file really exists in my fodler ! I have other JPG
> files and I have no warning message for them.
> Anyway, I do not think it is the source of the problem.
> But the final OSGJS does not appear with textures, as no texture is
> exported. The geometry is correct.
>
>
>
> Apparently I did something wrong, but I don't know where !
> If someone has an idea about this export issue ?
>
>
> Thanks a lot and have a good day,
> Mathieu
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=64482#64482
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Jordi Torres
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150727/739a2ca8/attachment-0003.htm>


More information about the osg-users mailing list