f3d-app / f3d

Fast and minimalist 3D viewer.
https://f3d.app
BSD 3-Clause "New" or "Revised" License
2.92k stars 215 forks source link

VRML files not displayed correctly #826

Open ferrellsl opened 1 year ago

ferrellsl commented 1 year ago

When loading VRML files the models are displayed as incomplete. Here's an example of how this rabbit model should look:

image

And here's how it displays in f3d:

image

This happens with all the VRML models I've tried so far.

mwestphal commented 1 year ago

Hi @ferrellsl

Please share an example VRML.

Thanks !

ferrellsl commented 1 year ago

I've also noticed that the missing parts are displayed on the the incorrect side of the model as well. Both ears on one side of the head and both arms and both legs are on one side of the body.

image

Here's the rabbit VRML file

rabbit.zip

ferrellsl commented 1 year ago

Here's another example of a snowman and how it should appear:

image

but in f3d, it renders like this:

image

Here's the zip file for the snowman:

snowman.zip

mwestphal commented 1 year ago

Here are examples VRML that works perfectly if that helps @ferrellsl : http://alexei.nfshost.com/3d/virtual.html

Looking at your data it looks like the Transform is not working as expected in vtkVRMLImporter that we use in F3D. I've opened an issue upstream but I'm not sure VTK devs will look into this as this class is not heavily used considering this bug has been present 8 years in VTK.

FYI @jpouderoux looks like you worked on this in VTK at some point :)

https://gitlab.kitware.com/vtk/vtk/-/issues/18982

ferrellsl commented 1 year ago

Here are examples VRML that works perfectly if that helps @ferrellsl : http://alexei.nfshost.com/3d/virtual.html

Looking at your data it looks like the Transform is not working as expected in vtkVRMLImporter that we use in F3D. I've opened an issue upstream but I'm not sure VTK devs will look into this as this class is not heavily used considering this bug has been present 8 years in VTK.

FYI @jpouderoux looks like you worked on this in VTK at some point :)

https://gitlab.kitware.com/vtk/vtk/-/issues/18982

Actually they don't all render perfectly. This one in particular totally crashes f3d on my system.

http://alexei.nfshost.com/3d/cockranm.wrl

mwestphal commented 1 year ago

Indeed, yet another issue in VTK.

https://gitlab.kitware.com/vtk/vtk/-/issues/18983

mwestphal commented 1 year ago

Both fixed in VTK and availiable in F3D nightly: https://github.com/f3d-app/f3d/releases/tag/nightly

enjoy @ferrellsl :)

ferrellsl commented 1 year ago

Well, that fixed most of the rabbit except its right eye and right whiskers, which should be black.

image

There's still an issue with geometry on the snowman model. It still renders improperly. The arms are missing, colors are missing, and the nose is on the wrong plane and not attached to the face as in the images I shared in my earlier post.

There also seems to be an issue with color space or color gradients. This lunar crater model should appear like this

image

But it gets rendered in green by f3d.

image

I've attached the lunar crater model lunar-crater.zip

jpouderoux commented 1 year ago

@ferrellsl Thanks for your report, I will take a look and see if we can fix that easily.

mwestphal commented 1 year ago

Any luck with that @jpouderoux ?

mwestphal commented 1 year ago

moving to 2.3

mwestphal commented 11 months ago

ping @jpouderoux