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

Michalis Kamburelis michalis.kambi at gmail.com
Sat Feb 25 20:57:51 PST 2023


I posted about X_ITE converter, focusing on SVG feature, on Castle
Game Engine news:
https://castle-engine.io/wp/2023/02/25/convert-svg-to-x3d-using-x_ite-to-display-svg-as-geometry-in-castle-game-engine/
.

I also finished a test of it using CGE engine logo, results on
https://github.com/castle-engine/demo-models/tree/master/svg . I fixed
the Z of geometries, and added a shader effect to discard pixels
outside of a circle (to simulate circular mask in SVG) and now I have
a perfect representation of our SVG logo in X3D!

Thank you and regards,
Michalis

pt., 24 lut 2023 o 17:30 Michalis Kamburelis
<michalis.kambi at gmail.com> napisał(a):
>
> AD 1 - OK, up to you about the Z values in SVG -- thanks for investigating!
>
>   Indeed making the final rendering correct requires also proper
> treatment of alpha blending -- ideally all shapes have the same
> Appearance.alphaMode and the X3D browser sorts the blended objects in
> a good way (in CGE, we have NavigationInfo.blendingSort with a few
> options -- "2D", "3D", "3D_ORIGIN",
> "3D_GROUND",https://castle-engine.io/apidoc/html/CastleRenderOptions.html#TBlendingSort
> ). I think we managed to make it work nicely in CGE (Spine animations
> and Tiled maps, both 2D formats with layers, look nicely in both 2D
> and 3D, both with orthographic and perspective) but indeed it was some
> work, the mere "trivially Z += epsilon" was not enough :)
>
> AD 2 - Thank you for information about "PLANE" type. So it is roughly
> similar to TCastle2DNavigation :), I have added handling of it to
> CGE/view3dscene.
>
> Regards,
> Michalis
>
>
> pt., 24 lut 2023 o 15:12 Holger Seelig <holger.seelig at yahoo.de> napisał(a):
> >
> > 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