[x3d-public] Nodes for V4

Leonard Daly Leonard.Daly at realism.com
Thu Sep 1 21:53:38 PDT 2016


Embedded comments...

> Hi Don,
>
> to me, the idea here is to be very pragmatic in order to make some 
> progress with html integration.

Agreed.


>
>     a. Not clear what your motivation is.  What functionality does a
>     Macro node provide that isn't already available using Script and
>     Prototype definitions?  Getting clear about differences helps
>     getting clear about goals.
>
>
> I agree, the Macro node would offer nothing that is not already 
> available with Protos. The issue is, however, that in the foreseeable 
> future Protos are not actually available with x3dom. To me it makes 
> sense to give a node with a more narrow and simpler functionality than 
> Protos a distinct name and distinct semantics.
> Even outside of x3dom it would be nice (although not necessary) to 
> have a simpler to understand, limited Proto, eg. just a Macro with 
> parameter substitution.

Agree with Andreas. Macro has less functionality than PROTO. PROTO can 
be incredibly complex (with new fields, etc.) and Scripting (which 
doesn't work in HTML). MACRO is a means of getting parse-type variable 
substitution and node expansion.


>
> A related question is if such a Macro node could coexist with Protos 
> if it would come to it, given their overlap. I think it probably 
> could. [To make it simple, one could disallow usage of Macros within 
> proto declarations and vice versa.] [[I think, usage of Macro 
> instances within Macro templates is currently not possible. Should it?]]

I think it is, though I haven't tried it. I think that creating a MACRO 
node with a string substitution would work.


>
> As a side note, in an html/DOM environment many scene creators would 
> use a templating engine:
> https://www.sitepoint.com/overview-javascript-templating-engines/
> But this requires some non-declarative programming and as such is 
> outside the scope of x3d.
>
>     b. Usage examples are often helpful for illustrating goals at this
>     stage of design.
>
>
> Since no internal computations are possible, usage would be limited. 
> There is still a class of useful templates: variations of color, 
> dimensions (eg., an arrow macro), perhaps 
> timesensor/interpolator/route animation macros, perhaps shaders with 
> parameters, probably many others.

I am using the MACRO capabilities to define new nodes. For example the 
initial development for SphericalVideo and StereoVIew use MACROs to 
expand the new node into the collection of existing nodes to do the 
work. This allows testing of node concepts without having to code the 
entire set of functionality into the node's JavaScript. Of course this 
only works when the node can be represented as an interacting set of 
existing nodes.


>
> [Currently, one could likely (ab-)use the Macro to also include a DOM 
> script node which would be affected by parameter substitution and 
> which then could set fields of x3d nodes in the instance with 
> computed/generated values upon execution during final parsing].
>
>     c. Previous efforts on NetworkSensor node, and the difficulties
>     encountered, may be worth considering:
>
>     http://www.web3d.org/x3d/content/examples/Basic/Networking/
>     <http://www.web3d.org/x3d/content/examples/Basic/Networking/>
>     http://www.web3d.org/x3d/content/examples/Basic/Networking/NetworkSensorConnectionPrototypes.x3d
>     <http://www.web3d.org/x3d/content/examples/Basic/Networking/NetworkSensorConnectionPrototypes.x3d>
>     http://www.web3d.org/x3d/content/examples/Basic/Networking/NetworkSensorConnectionPrototypes.html
>     <http://www.web3d.org/x3d/content/examples/Basic/Networking/NetworkSensorConnectionPrototypes.html>
>
>     http://www.web3d.org/x3d/content/examples/Basic/Networking/NetworkSensorConnectionNodes.html
>     <http://www.web3d.org/x3d/content/examples/Basic/Networking/NetworkSensorConnectionNodes.html>
>
>

I think this comment originated from a typo I made in the MACRO 
documentation. I referred to the parent class as X3DNetworkNode when it 
should have been X3DNetworkingNode. I apologize for any inconvenience or 
misunderstanding.


Leonard Daly






> I think the Macro node would not be able define new fields if this is 
> the concern. Is it ?
>
> some input,
>
> Andreas
>
> -- 
> Andreas Plesch
> 39 Barbara Rd.
> Waltham, MA 02453
>
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org


-- 
*Leonard Daly*
3D Systems & Cloud Consultant
X3D Co-Chair on Sabbatical
LA ACM SIGGRAPH Chair
President, Daly Realism - /Creating the Future/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160901/7eab9c37/attachment-0001.html>


More information about the x3d-public mailing list