cnr-isti-vclab / meshlab

The open source mesh processing system
http://www.meshlab.net
GNU General Public License v3.0
4.65k stars 818 forks source link

X3D exporter Issues #887

Open npolys opened 3 years ago

npolys commented 3 years ago

\Version

There are several issues with the current exporter having to do with the use of Appearance, Material and RGBA colorPerVertex

1] more consistent results will come from including an empty Appearance and Material node in the exported Shape

2] Normals are included in the output file, even when checked in the exporter dialogue

3] using color maps with opacity is very powerful... however the current exporter does not support the ColorRGBA node

https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-WD3/ballot/Part01/components/rendering.html

npolys commented 3 years ago

I have to say there are a few bugs here:

X3D importer removes Material from X3D files X3D exporter does not export Materials if present

Normals are included in the X3D despite checkbox setting

I will document the failure of textures to round-trip next...

npolys commented 3 years ago

Reference X3D models of a great variety can be used for testing : https://www.web3d.org/x3d/content/examples/X3dResources.html#Examples

alemuntoni commented 3 years ago

Thanks for reporting all these issues.

Right now I am not very familiar with the X3D format, therefore these wouldn't be just easy bugfixes for me. I can look into the x3d format when I'll find some free slots, but I don't know when (MeshLab is big there are a lot of things to maintain). If someone wants to help on solving these (or any other) issues, help is always welcome :)

npolys commented 3 years ago

I would be happy to work through these with you !

I know VRML and X3D very well but not so much about meshlab internal data structures.. .. :-]

with best regards, _n_polys

On Thu, Apr 8, 2021 at 11:24 AM Alessandro Muntoni @.***> wrote:

Thanks for reporting all these issues.

Right now I am not very familiar with the X3D format, therefore these wouldn't be just easy bugfixes for me. I can look into the x3d format when I'll find some free slots, but I don't know when (MeshLab is big there are a lot of things to maintain). If someone wants to help on solving these (or any other) issues, help is always welcome :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cnr-isti-vclab/meshlab/issues/887#issuecomment-815913281, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TSMYQ72TL2JCSIIFU553THXDCPANCNFSM4VSODU2A .

-- Nicholas F. Polys, Ph.D.

Director of Visual Computing Virginia Tech Research Computing

Affiliate Professor Virginia Tech Department of Computer Science

alemuntoni commented 3 years ago

Great! Well, meshes are stored into vcglib data structures (a small tutorial on how to use them can be found in the vcglib documentation), and the one used by meshlab is defined here.

The x3d importer/exporter is coded in the x3d plugin, and the functions that need to be fixed are the open and the save functions!

npolys commented 3 years ago

this is super~

can you please send me the vrml plugin links as well for reference?

br, -n

On Thu, Apr 8, 2021 at 11:56 AM Alessandro Muntoni @.***> wrote:

Great! Well, meshes are stored into vcglib data structures (a small tutorial on how to use them can be found in the vcglib documentation http://vcg.isti.cnr.it/vcglib/allocation.html), and the one used by meshlab is defined here https://github.com/cnr-isti-vclab/meshlab/blob/master/src/common/ml_document/cmesh.h .

The x3d importer/exporter is coded in the x3d plugin https://github.com/cnr-isti-vclab/meshlab/tree/master/src/meshlabplugins/io_x3d, and the functions that need to be fixed are the open https://github.com/cnr-isti-vclab/meshlab/blob/323a6d07c9ffccd05b781f41ebb112adf35ce100/src/meshlabplugins/io_x3d/io_x3d.cpp#L34 and the save https://github.com/cnr-isti-vclab/meshlab/blob/323a6d07c9ffccd05b781f41ebb112adf35ce100/src/meshlabplugins/io_x3d/io_x3d.cpp#L124 functions!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cnr-isti-vclab/meshlab/issues/887#issuecomment-815941948, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TSMZH2STEUYEBTHLARVDTHXGZBANCNFSM4VSODU2A .

-- Nicholas F. Polys, Ph.D.

Director of Visual Computing Virginia Tech Research Computing

Affiliate Professor Virginia Tech Department of Computer Science

alemuntoni commented 3 years ago

The x3d plugin handles both x3d and vrml! :) All the importer and exporter functions are placed inside the x3d plugin directory!

npolys commented 3 years ago

Thanks

The abstract spec is here https://www.web3d.org/documents/specifications/19775-1/V3.3/index.html ... it describes the content model for the scenegraph

it can be encoded in different formats (see ICANN MIME types)

but for XML: https://www.web3d.org/documents/specifications/19776-1/V3.3/index.html (... which is enforceable with DTD and Schema for parsing or serializing:-)

and the classic / vrml encoding (utf8) : https://www.web3d.org/documents/specifications/19776-2/V3.3/index.html

and there are lots of examples to test with, in all those encodings linked here: https://www.web3d.org/x3d/content/examples/X3dResources.html#Examples ... to our issue, see : https://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/Material/index.html

br, _n

On Thu, Apr 8, 2021 at 12:04 PM Alessandro Muntoni @.***> wrote:

The x3d plugin handles both x3d and vrml! :) All the importer and exporter functions are placed inside the x3d plugin https://github.com/cnr-isti-vclab/meshlab/tree/master/src/meshlabplugins/io_x3d directory!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cnr-isti-vclab/meshlab/issues/887#issuecomment-815948117, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TSMYLAQLFJBZWO6ONAB3THXHX5ANCNFSM4VSODU2A .

-- Nicholas F. Polys, Ph.D.

Director of Visual Computing Virginia Tech Research Computing

Affiliate Professor Virginia Tech Department of Computer Science

npolys commented 3 years ago

I think if you try a couple of simple / standard examples., you might see the issue...

with best regards, _nicholas

On Fri, Apr 9, 2021 at 1:21 AM Nicholas Polys @.***> wrote:

Thanks

The abstract spec is here https://www.web3d.org/documents/specifications/19775-1/V3.3/index.html ... it describes the content model for the scenegraph

it can be encoded in different formats (see ICANN MIME types)

but for XML: https://www.web3d.org/documents/specifications/19776-1/V3.3/index.html (... which is enforceable with DTD and Schema for parsing or serializing:-)

and the classic / vrml encoding (utf8) : https://www.web3d.org/documents/specifications/19776-2/V3.3/index.html

and there are lots of examples to test with, in all those encodings linked here: https://www.web3d.org/x3d/content/examples/X3dResources.html#Examples ... to our issue, see : https://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/Material/index.html

br, _n

On Thu, Apr 8, 2021 at 12:04 PM Alessandro Muntoni < @.***> wrote:

The x3d plugin handles both x3d and vrml! :) All the importer and exporter functions are placed inside the x3d plugin https://github.com/cnr-isti-vclab/meshlab/tree/master/src/meshlabplugins/io_x3d directory!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cnr-isti-vclab/meshlab/issues/887#issuecomment-815948117, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TSMYLAQLFJBZWO6ONAB3THXHX5ANCNFSM4VSODU2A .

-- Nicholas F. Polys, Ph.D.

Director of Visual Computing Virginia Tech Research Computing

Affiliate Professor Virginia Tech Department of Computer Science

-- Nicholas F. Polys, Ph.D.

Director of Visual Computing Virginia Tech Research Computing

Affiliate Professor Virginia Tech Department of Computer Science

npolys commented 3 years ago

Thanks for the links.

I see the parser means to support VRML (.wrl) and X3D (XML = .x3d ; classic = utf8.x3dv) lines 154-156

FYI, The file header carries some information as well

VRML V2.0 utf8

or <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" " https://www.web3d.org/specifications/x3d-3.0.dtd"> or

X3D V3.0 utf8

....

So in these ISO standards, meshes can have Normals and ColorPerVertex. IF these are in the data structured parsed on import, they are not respecting the exporter dialogue box options.

also ImageTextures (UV diffuse maps) can be bound to meshes (your 'wedge'?) should be supported (there is some code for that) https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/texturing.html#ImageTexture important parameters are described in the TextureTransform node and the TextureCoordinate node: https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/texturing.html#TextureTransform https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/texturing.html#TextureCoordinate

I don't see any code supporting the Appearance and Material node: https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/shape.html#Material

This file is a good example to test with (?) https://x3dgraphics.com/examples/X3dForAdvancedModeling/ShayDPixel/ShayDPixelVersion2Index.html

with best regards, _nicholas

On Fri, Apr 9, 2021 at 1:42 AM Nicholas Polys @.***> wrote:

I think if you try a couple of simple / standard examples., you might see the issue...

with best regards, _nicholas

On Fri, Apr 9, 2021 at 1:21 AM Nicholas Polys @.***> wrote:

Thanks

The abstract spec is here https://www.web3d.org/documents/specifications/19775-1/V3.3/index.html ... it describes the content model for the scenegraph

it can be encoded in different formats (see ICANN MIME types)

but for XML: https://www.web3d.org/documents/specifications/19776-1/V3.3/index.html (... which is enforceable with DTD and Schema for parsing or serializing:-)

and the classic / vrml encoding (utf8) : https://www.web3d.org/documents/specifications/19776-2/V3.3/index.html

and there are lots of examples to test with, in all those encodings linked here: https://www.web3d.org/x3d/content/examples/X3dResources.html#Examples ... to our issue, see : https://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/Material/index.html

br, _n

On Thu, Apr 8, 2021 at 12:04 PM Alessandro Muntoni < @.***> wrote:

The x3d plugin handles both x3d and vrml! :) All the importer and exporter functions are placed inside the x3d plugin https://github.com/cnr-isti-vclab/meshlab/tree/master/src/meshlabplugins/io_x3d directory!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cnr-isti-vclab/meshlab/issues/887#issuecomment-815948117, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TSMYLAQLFJBZWO6ONAB3THXHX5ANCNFSM4VSODU2A .

-- Nicholas F. Polys, Ph.D.

Director of Visual Computing Virginia Tech Research Computing

Affiliate Professor Virginia Tech Department of Computer Science

-- Nicholas F. Polys, Ph.D.

Director of Visual Computing Virginia Tech Research Computing

Affiliate Professor Virginia Tech Department of Computer Science

-- Nicholas F. Polys, Ph.D.

Director of Visual Computing Virginia Tech Research Computing

Affiliate Professor Virginia Tech Department of Computer Science

alemuntoni commented 3 years ago

Hi @npolys,

I think that you are replying everytime via email, which do not show correctly what's happening on github.

958 just mentioned this issue, and it has been actually already solved with the PR #959.

As I said in previous replies, right now study the X3D format to solve all the issues related to the importer/exporter in meshlab is not in the top of my priority list. Help is always appreciated (see #959), but right now I cannot say when X3D issues will be solved.

npolys commented 3 years ago

Thanks~!:-)

You all are hosting the SIGGRAPH 26th annual Web3D Conference later this year :-)

... so that will be a great chance to be heros in supporting X3D 4 https://www.web3d.org/x3dv4-highlights

... Glory ! Fame ! Eternal Rewards! :-)

https://web3d2021.isti.cnr.it/

br, _n

On Wed, Apr 21, 2021 at 10:59 AM Alessandro Muntoni < @.***> wrote:

Hi @npolys https://github.com/npolys,

I think that you are replying everytime via email, which do not show correctly what's happening on github.

958 https://github.com/cnr-isti-vclab/meshlab/issues/958 just

mentioned this issue, and it has been actually already solved with the PR

959 https://github.com/cnr-isti-vclab/meshlab/pull/959.

As I said in previous replies, right now study the X3D format to solve all the issues related to the importer/exporter in meshlab is not in the top of my priority list. Help is always appreciated (see #959 https://github.com/cnr-isti-vclab/meshlab/pull/959), but right now I cannot say when X3D issues will be solved.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cnr-isti-vclab/meshlab/issues/887#issuecomment-824130159, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TSMZKWUDV6URTSOZ44GLTJ3R3PANCNFSM4VSODU2A .

-- Nicholas F. Polys, Ph.D.

Director of Visual Computing Virginia Tech Research Computing

Affiliate Professor Virginia Tech Department of Computer Science

npolys commented 2 years ago

This is a bug because the Materials are not exported to X3D at all.