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

2015-07-27 Thread Mathieu Bartillat
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@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2015-07-27 Thread Jordi Torres
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 :

> 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@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Jordi Torres
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2015-07-28 Thread Mathieu Bartillat
Hello Jordi, thanks a lot for your answer.

I tried to use the gles plugin with the command described in the link you sent, 
but osgconv.exe crashes (no log message).

I tried with an IVE and an OSGB files as input.

So far the only way I have not to receive the error (Fatal nb colors 1 != 1349) 
is to get an OBJ from the graphist without texture. Texture files are in a 
separate folder /images.
Then I can convert to an OSGJS format.
In this file I have references to the textures in some fields, such as:
"File": "images\\base_age.tga", 

But when I load it, even if I put textures in the folder //images, they do not 
appear.
And in the Chrome console I have this:
warning use white texture as fallback instead of images\valve.tga
warning use white texture as fallback instead of images\alu_txt.tga
and so on...

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64503#64503





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2015-07-28 Thread Jordi Torres
Hi Mathieu,

2015-07-28 9:37 GMT+02:00 Mathieu Bartillat :

> Hello Jordi, thanks a lot for your answer.
>
> I tried to use the gles plugin with the command described in the link you
> sent, but osgconv.exe crashes (no log message).
>
>
Could you share the model, or a part of it to reproduce the crash? That
will help to debug.

 I tried with an IVE and an OSGB files as input.

>
> So far the only way I have not to receive the error (Fatal nb colors 1 !=
> 1349) is to get an OBJ from the graphist without texture. Texture files are
> in a separate folder /images.
> Then I can convert to an OSGJS format.
> In this file I have references to the textures in some fields, such as:
> "File": "images\\base_age.tga",
>
> But when I load it, even if I put textures in the folder //images, they do
> not appear.
> And in the Chrome console I have this:
> warning use white texture as fallback instead of images\valve.tga
> warning use white texture as fallback instead of images\alu_txt.tga
> and so on...
>
> That message means that osgjs is not founding the textures. Are you using
a server like apache or similar? It is a must to work with separate
textures, also the textures should be in the route they appear in the osgjs
file.

By the way did you try the inline textures feature?

Cheers.




> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=64503#64503
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Jordi Torres
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2015-07-28 Thread Jordi Torres
Ok I will try to be clerarer:

1. Can you please share the ive model or a part of it to debug the crash?
Otherwise is almost impossible to know what is happening.

2. Tga textures are not supported in the browser, you'll need to write them
out to jpg.

3. You *must use the gles *pseudo-reader to avoid the Fatal nb colors.

4. Did you try the inline images feature? Did it work?

  Cheers.


> Well, I can show this very simple example with one IVE and 2 texture
> files.
>
> I cannot convert directly to OSGJS format.
> IVE --> OSGJS does not work (Fatal nb colors log)
> IVE --> OSG works
> OSG --> OSGJS does not work (Fatal nb colors log)
> OSG --> OBJ works
> OBJ --> OSGJS works but I have 2 logs saying that some faces were reversed
> by the plugin
> And if I try to load this model (with the textures in a folder \\images at
> the same location of the java script file) I cannot see the texture. Chrome
> moans:
> warning use white texture as fallback instead of images\tree_03.tga
>
> Thanks in advance !
> Mathieu
>

2015-07-28 9:45 GMT+02:00 Jordi Torres :

> Hi Mathieu,
>
> 2015-07-28 9:37 GMT+02:00 Mathieu Bartillat <
> mathieu.rouge...@telespazio.com>:
>
>> Hello Jordi, thanks a lot for your answer.
>>
>> I tried to use the gles plugin with the command described in the link you
>> sent, but osgconv.exe crashes (no log message).
>>
>>
> Could you share the model, or a part of it to reproduce the crash? That
> will help to debug.
>
>  I tried with an IVE and an OSGB files as input.
>
>>
>> So far the only way I have not to receive the error (Fatal nb colors 1 !=
>> 1349) is to get an OBJ from the graphist without texture. Texture files are
>> in a separate folder /images.
>> Then I can convert to an OSGJS format.
>> In this file I have references to the textures in some fields, such as:
>> "File": "images\\base_age.tga",
>>
>> But when I load it, even if I put textures in the folder //images, they
>> do not appear.
>> And in the Chrome console I have this:
>> warning use white texture as fallback instead of images\valve.tga
>> warning use white texture as fallback instead of images\alu_txt.tga
>> and so on...
>>
>> That message means that osgjs is not founding the textures. Are you using
> a server like apache or similar? It is a must to work with separate
> textures, also the textures should be in the route they appear in the osgjs
> file.
>
> By the way did you try the inline textures feature?
>
> Cheers.
>
>
>
>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=64503#64503
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
>
> --
> Jordi Torres
>
>
>


-- 
Jordi Torres
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org