[x3d-public] vrml conversions

Andreas Plesch andreasplesch at gmail.com
Mon Aug 14 12:56:43 PDT 2023


https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/df593e4f82b3fbd99148583ecb235edd/raw/d21237d4ee23a419eb28853ca9cd8fd96e1f5e0b/hyper_6_4_2.x3d

is another conversion from http://bulatov.org/vrml/, a hyperbolic
kaleidoscope with some minor changes.

In addition to the use of Protos it shows how to use shared
initialization and variable scope across multiple script output
functions/fields as the original vrml script does the same, in a
single script node.

Cheers, Andreas

On Sat, Aug 12, 2023 at 12:07 AM Andreas Plesch <andreasplesch at gmail.com> wrote:
>
> Another vrml conversion from http://bulatov.org/vrml/easter/index.html
>
> https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/df593e4f82b3fbd99148583ecb235edd/raw/7d3caceb31b83484711d56bc00d4c5d8107fa6bf/egg10.x3d
>
> A few interesting x3dom related aspects here are:
>
> - Protos work pretty well in x3dom, even if complicated
> - For IS protofields it is sometimes necessary to provide appropriate
> default values also in the Protobody (not just in the ProtoInterface)
> in case the x3d default values cause problems. This happened here
> because the TextureCoordinate node does not have point coordinates by
> default. x3dom probably should ignore TextureCoordinate nodes with an
> empty point field and treat that as if there is no TextureCoordinate
> node.
> - X3D scripts can be converted to DOM javascripts almost 1:1. ROUTEs
> become the onoutputchange attribute with a function to call for the
> fromNode, and the script itself finds the toNode in directOutput
> style. The conversion shows a more complicated example which includes
> use of wrapper function to avoid global (page wide) variables.
> - HTML weirdness: Script DOM nodes generated 'from scratch' and then
> appended to the page document execute when this happens. However,
> Script DOM nodes generated with the builtin DOMParser or with
> outer/innerHTML parsing are marked and do not execute when appended to
> the page document. There is another, more obscure parsing method which
> does generate executable Script nodes. This is what the editor now
> uses.
>
> Andreas
>
> On Sat, Aug 5, 2023 at 4:44 PM Andreas Plesch <andreasplesch at gmail.com> wrote:
> >
> > Slightly adapted from http://bulatov.org/vrml/:after conversion to xml
> > with x-ite:
> >
> > https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/df593e4f82b3fbd99148583ecb235edd/raw/821419402327bd6927d2701174a29c5d078edc18/eversion.x3d
> >
> > https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/df593e4f82b3fbd99148583ecb235edd/raw/3af8bc0d53e157c9289eb18831672f8ef1ca033a/dodecahedron.x3d
> >
> > Cheers, Andreas
> > --
> > Andreas Plesch
> > Waltham, MA 02453
>
>
>
> --
> Andreas Plesch
> Waltham, MA 02453



-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list