[x3d-public] loadURL browser object SAI function proposal
GPU Group
gpugroup at gmail.com
Wed May 30 06:05:59 PDT 2018
IIRC Browser.loadURL(url,param) is from vrml days and some desktop browsers
support it in x3d.
Browser.send() Browser.recv() might be useful additions.
-Doug
more..
here's a spec comment I made in April about distirbuted interactive
simulation (DIS) component, which suggests using a separate bridge module
outside web3d specs to talk DIS and convert to node synchronization via
Browser.send/Browser.recv.
spec comment on DIS
======================================
Problem: to get navy and military support, web3d needs DIS and/or HLA
components. We have a DIS component. But its a tiny fraction of the whole
DIS standard. And no HLA. A disappointing subset of those 2 sim specs, yet
even with a small subset web3d.org browser developers complain and haven't
broadly implemented the current few DIS nodes. How disappointing.
Solution:
1. For desktop add to javascript SAI: Browser.send(), Browser.recv()
- can be used to sync Script node fields between x3d browsers
-
http://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#ScriptImplementation
- prepareEvents() - called each frame, call Browser.recv() from here
- call Browser.send from each inputOnly event function
- Non-DIS goal: synchronize the Script node fields between 2 browsers, by
sending and receiving the fields
- can use non-DIS, non-HLA wireline protocol and udp local broadcast IP
address
2. for html profile, use websockets, same as #1, (similar to websockets Don
was thinking about)
3. specify an external DIS-X3D bridge, and HLA-X3D bridge
a) bridge-script node: syncrhonize structs in the bridge with the Script
node
- script eventOuts are routed to keep Transforms up to date, and those
transforms are like the espdu transforms
b) The bridge could be in the desktop browser in another thread
- or an external program
-- benefit: fewer web3d browser developers would need to grunt through the
bridge development if they could share code
-- they just need to do the Browser.send, Browser.recv
- or for html profile in a nodejs server
The DIS and HLA bridges could evolve to support more of the DIS and HLA
standards
- implement any simulation-agreement specifics
- use the #defines in the header files from moves institute (hard to do in
x3d ie deadReckoning='DIS:DRM_FVW' is awkward in x3d)
- if one browser implements both current DIS Component and Browser.send,
Browser.recv, then it can act as a bridge for other web3d browsers
Benefits:
1. much easier for web3d browser developers to support if they can share a
bridge utility
2. there are other uses for Browser.send, Browser.recv, such as having fun
syncrhonizing nodes in 2 browsers, more motivating for non-MIL browser
developers to implement
3. DIS bridge can evolve to support more of the standard without having to
drag web3d.org speccs with it,
thereby supporting more of the DIS specs
4. HLA bridge can be added using same Browser.send, .recv synchronization
techniques.
======================================
On Tue, May 29, 2018 at 1:41 AM, John Carlson <yottzumm at gmail.com> wrote:
> I got some clue. Will report elsewhere.
>
>
>
> John
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *John Carlson <yottzumm at gmail.com>
> *Sent: *Monday, May 28, 2018 6:15 PM
>
> *To: *Andreas Plesch <andreasplesch at gmail.com>
> *Cc: *X3D Graphics public mailing list <x3d-public at web3d.org>
> *Subject: *RE: [x3d-public] loadURL browser object SAI function proposal
>
>
>
> Nope. This is the only version I could get working:
>
>
>
> function load_X3DOM_JSON(jsobj, selector) {
>
> var doc = document.querySelector(selector);
>
> if (doc.hasRuntime && doc.runtime.ready) {
>
> doc.runtime.loadJS(jsobj);
>
> }
>
> // remove all text nodes in scripts (and fields too, sigh)
>
> $(selector+" Script").empty();
>
> }
>
>
>
> This same version doesn’t work below, only works on localhost, but I swear
> I tested it: It’s gotta be caching or????
>
>
>
> https://coderextreme.net/X3DJSONLD/src/main/html/prototypes.html
>
>
>
> Now it’s working. NO changes on coderextreme.net at all.
>
>
> I can’t get any other version of this code working, including adding urls,
> etc. Suggestions for replacement code are welcome, or pull requests to
> X3DJSONLD
>
>
>
> Various attempts at reloading the page have been tried too.
>
>
>
> John
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *John Carlson <yottzumm at gmail.com>
> *Sent: *Monday, May 28, 2018 5:51 PM
> *To: *Andreas Plesch <andreasplesch at gmail.com>
> *Cc: *X3D Graphics public mailing list <x3d-public at web3d.org>
> *Subject: *RE: [x3d-public] loadURL browser object SAI function proposal
>
>
>
> Figured it out I think. Testing.
>
>
>
> John
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *John Carlson <yottzumm at gmail.com>
> *Sent: *Monday, May 28, 2018 5:47 PM
> *To: *Andreas Plesch <andreasplesch at gmail.com>
> *Cc: *X3D Graphics public mailing list <x3d-public at web3d.org>
> *Subject: *RE: [x3d-public] loadURL browser object SAI function proposal
>
>
>
> Well, when I take loadJS out of my code, it ceases to function?
>
>
>
> I’m frankly puzzled.
>
>
>
> John
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *Andreas Plesch <andreasplesch at gmail.com>
> *Sent: *Monday, May 28, 2018 5:36 PM
> *To: *John Carlson <yottzumm at gmail.com>
> *Cc: *X3D Graphics public mailing list <x3d-public at web3d.org>
> *Subject: *Re: [x3d-public] loadURL browser object SAI function proposal
>
>
>
> Not sure if loadJS would be a good idea: It is literally one line:
>
> browser.replaceWorld(browser.createX3DfromJS(jsobject))
>
> Error/null checking needs to occur in both of these functions anyways.
>
> loadURL is mainly available to hide Promises.
>
>
>
> -Andreas
>
>
>
>
>
> On Mon, May 28, 2018 at 5:06 PM, John Carlson <yottzumm at gmail.com> wrote:
>
> > I added loadJS, too. I can probably take it out, since it doesn’t use an
>
> > asynchronous nature. However, it is convenient.
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > Here’s an example:
>
> >
>
> >
>
> >
>
> > https://coderextreme.net/X3DJSONLD/src/main/html/prototypes.html
>
> >
>
> >
>
> >
>
> > (note it uses an x3dom-full.debug.js on the site).
>
> >
>
> >
>
> >
>
> > John
>
> >
>
> >
>
> >
>
> > Sent from Mail for Windows 10
>
> >
>
> >
>
> >
>
> > From: Andreas Plesch
>
> > Sent: Monday, May 28, 2018 4:01 PM
>
> > To: X3D Graphics public mailing list
>
> > Subject: [x3d-public] loadURL browser object SAI function proposal
>
> >
>
> >
>
> >
>
> > Table 7.3 list the browser object SAI functions for JS:
>
> >
>
> >
>
> >
>
> > http://www.web3d.org/documents/specifications/
> 19777-1/V3.3/Part1/functions.html#t-FunctionsBrowserObject
>
> >
>
> >
>
> >
>
> > So in order load a new scene from a URL into the current browser, one
>
> >
>
> > first creates a new x3dscene from the URL and then replaces the
>
> >
>
> > current world with the new scene.
>
> >
>
> >
>
> >
>
> > John and I are adding these browser SAI functions more formally to
>
> >
>
> > x3dom, along with supporting json as string, url, or object using
>
> >
>
> > John's parser and expander. It works pretty well but it turned out to
>
> >
>
> > be useful to add an additional function: loadURL(url).
>
> >
>
> >
>
> >
>
> > It just just combines the two steps into one. Apart from addressing
>
> >
>
> > the most common use case for these functions by making this easier,
>
> >
>
> > loadURL also hides the asynchronous nature of downloading which is
>
> >
>
> > strongly preferred these days. An app does not block while potentially
>
> >
>
> > downloading slowly, or finally timing out. The function knows
>
> >
>
> > internally when the download is available and then replaces the world.
>
> >
>
> > In x3dom there is then another user definable function which is called
>
> >
>
> > when the world is completely loaded. I think there is an equivalent
>
> >
>
> > event in x3d. So the function is still asynchronous but allows for
>
> >
>
> > familiar methods to proceed when the scene is available.
>
> >
>
> >
>
> >
>
> > Practically, for x3dom users, having loadURL means not having to know
>
> >
>
> > or learn Promises and still have a performant, and easy way to load a
>
> >
>
> > new scene.
>
> >
>
> >
>
> >
>
> > Here is an example which loads new scenes in various ways:
>
> >
>
> > https://rawgit.com/x3dom/x3dom/browserSAI/test/functional/runtime.html#
>
> >
>
> > The expanded world option loads remote json, after expanding protos.
>
> >
>
> >
>
> >
>
> > My question is then if other x3d browser have such a convenience
>
> >
>
> > loadURL SAI function, potentially asynchronous, and if there is an
>
> >
>
> > informal standard to follow.
>
> >
>
> >
>
> >
>
> > -Andreas
>
> >
>
> >
>
> >
>
> > --
>
> >
>
> > Andreas Plesch
>
> >
>
> > Waltham, MA 02453
>
> >
>
> >
>
> >
>
> > _______________________________________________
>
> >
>
> > x3d-public mailing list
>
> >
>
> > x3d-public at web3d.org
>
> >
>
> > http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
> >
>
> >
>
>
>
>
>
>
>
> --
>
> Andreas Plesch
>
> Waltham, MA 02453
>
>
>
>
>
>
>
>
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180530/80ce7b47/attachment-0001.html>
More information about the x3d-public
mailing list