[x3d-public] protos for v4: x3dom + cobweb?

Don Brutzman brutzman at nps.edu
Thu Feb 18 11:23:32 PST 2016


A lot of work went into the _X3D for Web Authors_ chapter and slideset and videos on the subject of Script nodes and execution model.  I hope you find them useful.

http://x3dgraphics.com
http://x3dgraphics.com/slidesets/X3dForWebAuthors/Chapter09-EventUtilitiesScripting.pdf
http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting
https://www.movesinstitute.org/Video/Courses/X3dForWebAuthors/X3dForWebAuthorsVideo.html#9

Similar resources are available for prototypes.

http://x3dgraphics.com/slidesets/X3dForWebAuthors/Chapter14-Prototypes.pdf
http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter14-Prototypes
https://www.movesinstitute.org/Video/Courses/X3dForWebAuthors/X3dForWebAuthorsVideo.html#14

Have fun with X3D!  8)

On 1/29/2016 11:45 AM, Joe D Williams wrote:
>> when it comes to routes, they are like ...
>
> Great, implement this anyway you wish, just as long as it works as described in the standard.
> The list is live and I can modify it at any time. The event graph is a fantastic authoring and troubleshooting tools when done right. The ideas of subscribers and publishers (DOM?) is mostly valid for VRML/X3D, but you really don't want to be figuring and flagging a bunch of event routing stuff out while trying to be realtime interactive.
>
>>  the routing algo iterates (called cascading)
>
> Great, you make it seem fairly simple. Please do not overlook the most important point is that all events having the same time stamp are completed in the current frame.
>
> publishers/subscribers, to me these are source gozoutas and sink gozintas
>
>> Then goes through each publisher field, checking if the publisher field has changed.
>
> First you care if time has changed, You don't care if field has changed if there is no subscriber
>
> - if so it copies data from the blah to blahs
> -telling a subscriber -script/interpolator node- to update itself-
> what do you tell it?
> then clears the change flag on the publisher field ...
>
> I guess, OK, and I guess you can optimize for scripts, interps, and others where you know there wil be an event each frame but really, you want to know this stuff ahead of time not have to figure it out as you go.
>
> A frame may include events with different time stamps in the same frame if the author allows it, but no leakies where you have part of your event list appear in one frame and some in the next.
>
>>> Don't get "direct outputs" or "directOuts" mixed up with normal
> operation.
>
> Are we fairly clear on this directOutput stuffs for Script?
>
>
>> when it comes to routes, they are like ...
>
> http://www.web3d.org/wiki/index.php/About_the_X3D/VRML_ROUTE_statement
>
> Thanks for All,
> Joe
> http://www.hypermultimedia.com/x3d/hanim/JoeH-AnimKick1a.x3dv
> (works as expected with Safari on XP with BSContact latest free installed.)
>
>
>
>
>
> ---- Original Message ----- From: "doug sanden" <highaspirations at hotmail.com>
> To: "X3D Graphics public mailing list" <x3d-public at web3d.org>
> Sent: Friday, January 29, 2016 9:02 AM
> Subject: Re: [x3d-public] protos for v4: x3dom + cobweb?
>
>
> John, Re: execution model:
> Yes and the v3.3 execution model:
> http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/concepts.html#ExecutionModel
> when it comes to routes, they are like events, except instead of each publisher holding a list of subscribers, the route list is a list of subscriptions from any publisher to any subscriber.
> In practical terms, when an output (inout or out) field is changed, a flag on the field is set to indicate it changed.
> Then the routing function is called, it goes through the list of routes, sorting them by publisher field.
> Then goes through each publisher field, checking if the publisher field has changed.
> - if so it copies data from the publish field to all the subscriber fields -telling a subscriber -script/interpolator node- to update itself- then clears the change flag on the publisher field.
> Since during updating themselves, a subscriber may change one of its output field changed flags, the routing algo iterates (called cascading) until no more changed publisher fields are found.
> -Doug
> more.. here's freewrl's spaghetti C function for the routing algo propagate_events_B() on Line 2568
> http://sourceforge.net/p/freewrl/git/ci/develop/tree/freex3d/src/lib/vrml_parser/CRoutes.c
>
> ________________________________________
>
>
>
>> So you have to keep all events around until all direct outputs are
>> sent?
>
> Main idea, the X3D Script node is (can be) a full featured Sensor node
> and basically runs like all other nodes; is smart.
>
> Right, no sense sending events as they are set, unless you really need
> to.
>
> Don't get "direct outputs" or "directOuts" mixed up with normal
> operation.
>
> You declare each directOut.
> Figure that directOut means the Script node has direct access to the
> gozinta of another node (no route required) and thus will be sent as
> set.
> To some, this is like existing real life everywhere, but to X3D it is
> the exception because preservation of the cascade is most
> important.and besides we like routes.
>
> If tuning, you send periodic updates via the cascade, but if you need
> to use a hammer, then you can kick only it without distrurbing the
> rest using a directOut
>
> So, the idea is that all events are sent in sequence when the script
> is complete, then contol is returned. Still, this might not result in
> actual update of graph if cascade is not complete, I think.
>
>> How do you create a cascade?
>
> Let's look at the abstract and SAI, but the initial event gets a time
> stamp and all events in that cascade have the same time stamp. All
> events in a cascade happen at the same time, or instantaneously.
>
>>  What is “complete”?
>
> There are some words for this having to do with control being passed
> between the Script node and the system.
>
>>  Parsed?
>
> something gets parsed somewhere sometime, I guess.
> There are strict tules about when scripts are alive and can be called
>
>> How do scripts “run”,
>
> a function has an entry and an exit point. The part that allows the
> script node to do its thing passes control
>
>>  when they are a collection of functions?
>
> then 'this' for sure. a Script node can include several functions;
> some have predefined names.
>
>> Are functions events?
>
> the gozintas and gozoutas of the functions are events
>
> next I would start looking at 4 Concepts and SAI definitions.
>
> Basically all operations (like Script node) are the same for VRML2/97
> and X3D, just the old VRML EIA was replaced by better
> internal/external alignment of X3D SAI.
>
> Thanks,
> Joe
>
>
>
>
>
>> On Jan 28, 2016, at 1:10 PM, Joe D Williams <joedwil at earthlink.net>
>> wrote:
>>
>> The X3D execution model is simple.
>>
>> The script is this.
>>
>> Events are sent when the script is complete.
>>
>> Events are part of the current cascade.
>>
>> DirectOutputs are sent as set, outside the current cascade.
>>
>> Joe
>>
>>
>>
>>
>> ----- Original Message ----- From: "John Carlson"
>> <yottzumm at gmail.com <mailto:yottzumm at gmail.com>>
>> To: "doug sanden" <highaspirations at hotmail.com
>> <mailto:highaspirations at hotmail.com>>
>> Cc: "X3D Graphics public mailing list" <x3d-public at web3d.org
>> <mailto:x3d-public at web3d.org>>
>> Sent: Thursday, January 28, 2016 7:05 AM
>> Subject: Re: [x3d-public] protos for v4: x3dom + cobweb?
>>
>>
>> Here’s a good start on porting Scripts from X3D to X3DOM:
>>
>> https://github.com/coderextreme/X3DJSONLD/blob/master/Script.js
>> <https://github.com/coderextreme/X3DJSONLD/blob/master/Script.js><https://github.com/coderextreme/X3DJSONLD/blob/master/Script.js
>> <https://github.com/coderextreme/X3DJSONLD/blob/master/Script.js>>
>>
>> download the code with:
>>
>> git clone https://github.com/coderextreme/X3DJSONLD/
>> <https://github.com/coderextreme/X3DJSONLD/>
>>
>> I need help understanding the X3D execution model.  Right now, it’s
>> all messed up.
>>
>> This is a driver for it:
>>
>> https://github.com/coderextreme/X3DJSONLD/blob/master/PPP.js
>> <https://github.com/coderextreme/X3DJSONLD/blob/master/PPP.js><https://github.com/coderextreme/X3DJSONLD/blob/master/PPP.js
>> <https://github.com/coderextreme/X3DJSONLD/blob/master/PPP.js>>
>> which generates the JavaScript and evals (yuck!) it.
>>
>> I’m not sure prototypes need too much more work, but you can try
>> converting your prototypes to JSON and expanding them.  it would be
>> helpful to get a
>> tester.  I would just like to get scripting working in the short
>> term. That’s my priority 1 item besides validating and encoding JSON
>> for display in X3DOM.
>>
>> We can add stuff like the requestFieldRef and releaseFieldRef to the
>> X3D JSON loader for X3DOM soon as well.  Question:  Can I request
>> and release in quick succession, and can I use objects and arrays to
>> set the values of the requested field?
>>
>> This code allows for Cross Site Scripting (XSS) if used improperly!
>> Know your data (no don’t trust it), or validate with schema and
>> encode (yes we are working on it).
>>
>> John
>>> On Jan 28, 2016, at 9:42 AM, John Carlson <yottzumm at gmail.com>
>>> wrote:
>>>
>>> Think of Cobweb as a classic VRML silo ported to the web.  At least
>>> that’s what it seems like to me.  You must use VRML types in your
>>> VRMLscript, it’s not JavaScript.
>>>
>>> But yeah, if I read your subject right, you want to port Cobweb
>>> protos to X3DOM.  I believe scripts would have to be ported as
>>> well. It might be worth investigating.
>>>
>>> John
>>>> On Jan 28, 2016, at 9:19 AM, John Carlson <yottzumm at gmail.com>
>>>> wrote:
>>>>
>>>> AFAIK, Cobweb does not do DOM or JQuery.  Protos can be used with
>>>> X3DOM, using my prototype expander for JSON (in beta), but not
>>>> VRMLscript (partial implementation, alpha or pre alpha).
>>>> We need to figure out how to route to and from scripts in X3DOM.
>>>> See my many postings pleading for help.  If you would want to
>>>> help, I can show you the ropes.
>>>>
>>>> The alternative to Protos for X3DOM is web components, which is
>>>> what the X3DOM folks are proposing.
>>>>
>>>> John
>>>>> On Jan 28, 2016, at 9:13 AM, doug sanden
>>>>> <highaspirations at hotmail.com> wrote:
>>>>>
>>>>>
>>>>> Q. could protos for V4 be in cobweb format?
>>>>> -Doug
>>>>> Goal: keep the jQuery/DOM crowd happy, but just up to the
>>>>> interface of a proto, not its body.
>>>>> x I have not studied any techical details of either x3dom or
>>>>> cobweb, I have no idea if its doable/practical
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> x3d-public mailing list
>>>>> x3d-public at web3d.org
>>>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>>>
>>>
>>
>>
>>
>>
>> --------------------------------------------------------------------------------
>>
>>
>>> _______________________________________________
>>> x3d-public mailing list
>>> x3d-public at web3d.org <mailto:x3d-public at web3d.org>
>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>> <http://web3d.org/mailman/listinfo/x3d-public_web3d.org>
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org


all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list