[x3d-public] Online X3D File Format Converter Powered by X_ITE

Holger Seelig holger.seelig at yahoo.de
Fri Feb 24 06:11:56 PST 2023


My intension to write the SVG parser was to be able to import some 2D shapes not easily to be created in X3D, like logo shapes or other stuff probably to be used in a HUD layout with curves or so, the shapes shall not overlap.

Real SVG images with lots of object and layers can be converted, but then there is the Z-fighting issue. These images are probably best viewed with real SVG viewers (browser, Inkscape, or Illustrator). 3D is not designed to be able to handle this, even if there is some kind of Z-value added to each object. Try it and you will see that it will not always solve the issue. It depends on how Z-ordering is done in 3D, especially of transparent object, which will probably depend on the X3D browser uses.

I will therefore not add a Z-value to each object. This must be done in a post-processing step by the author itself. The author can then decide how much depth must be added.

Best regards,
Holger

> Am 23.02.2023 um 18:11 schrieb Michalis Kamburelis <michalis.kambi at gmail.com>:
> 
> Cool!
> 
> I tested on 2 SVG files ( A.
> https://github.com/castle-engine/castle-engine/blob/master/tools/castle-editor/gfx/gizmos/light/light_point.svg
> , B. https://github.com/castle-engine/castle-engine/blob/master/doc/pasdoc/logo/castle_game_engine_icon.svg
> ). Fantastic, I can read resulting files in CGE and view3dscene, I
> have real 3D geometry from SVG!
> 
> Notes:
> 
> 1. On test B (CGE logo), the rendering is not perfect, and there's
> Z-fighting if I rotate it slightly in 3D. From what I saw in the X3D
> source, that's because everything is on Z = 0.
> 
>    Do you think it's sensible to introduce some "Z += epsilon" shift,
> when generating X3D, to counter this?
> 
>    In CGE/view3dscene, we had similar situation for Spine (2D
> animations) and Tiled (2D maps) input files. When converting to X3D,
> we indeed just added Z += epsilon for each layer, to avoid the
> problem.
> 
> 2. I see the models use NavigationInfo.type =
> "PLANE_create3000.github.io" and "PLANE". I don't see this documented
> on https://create3000.github.io/x_ite/components/navigation/navigationinfo
> . Is it something like a dedicated 2D navigation? If yes, we have also
> a dedicated 2D navigation in CGE, so I could likely add in CGE to
> handle "PLANE_create3000.github.io" / "PLANE" types.
> 
> Thank you very much for this. And sorry for focusing so much on SVG :)
> I know what you did is much more general, I just focused on SVG->X3D
> as for my use-cases this is the biggest game-changer. I will post
> about this on CGE news ( https://castle-engine.io/wp/ ) this weekend.
> 
> Regards,
> Michalis
> 
> 
> 
> czw., 23 lut 2023 o 15:39 Holger Seelig <holger.seelig at yahoo.de> napisał(a):
>> 
>> The converter is now online and can be found at:
>> 
>> https://create3000.github.io/x_ite/laboratory/x3d-file-converter
>> 
>> @Michalis Yes SVG is converted into vectors and thus can be scaled as you like.
>> 
>> Best regrads,
>> Holger
>> 
>> 
> <castle_game_engine_icon_0.png><light_point_0.png>




More information about the x3d-public mailing list