[x3d-public] Anchor target within scene

Leonard Daly Leonard.Daly at realism.com
Fri Jan 11 21:19:38 PST 2019


Hi Albert,

The basic answer to your question (using JavaScript) is sort-of. 
Whatever you do, it must use the X3D API (aka SAI) to send a 
removeChildren then an addChildren event has to send parsed X3D nodes to 
the Group/Transform node. This can be done in JavaScript or Java or any 
other language where there is the SAI library supported by the 3D 
browser. In the case of a web browser this is only JavaScript; provided 
that the X3D display library running in the web page "knows" how to do that.

A non-X3D, but DOM way to do it would be to just use the DOM methods 
appendChild and related ones (see 
https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild). The 
X3D run-time would need to declare a mutation observer to catch the 
change to the DOM and appropriate handle the scene graph.

I am concerned about your statement relating to iframe. In DOM-land an 
iframe defines a new name space with a barrier between the enclosing 
frame and the content frame. It defines a rectangular region in the 
display where the target has sole control (at least at the z-index where 
it is declared). What you are describing is reading in content from an 
external source and inserting the new content into the existing scene 
graph in the same name scope. In your example, there is no exclusion 
region in virtual space, nor a name scope barrier as you discuss it.

A closer analogy between HTML and X3D would be the iframe and Inline 
nodes. Inline has the capability to load and unload remote content. You 
can send the Inline node a new URL. It will unload any content it 
loaded, then load the new content. It maintains a semi-permeable barrier 
between the parent (content with the Inline) and children (content 
loaded by Inline).

This mechanism requires JavaScript to process the button, but the messy 
work of changing content is all handled by Inline by changing the url field.

Leonard Daly




> One of the most useful implementations of the anchor in our 
> experimental XR browser was to be able to specify a (Transform) node 
> within the 3D scene as a target,  where the new x3d content would be 
> displayed.
> (This mimics the functionality of the (I)frame in 2d)
>
> It allowed us for example to define some objects as (3d) buttons, each 
> with and anchor to a X3D file containing a model, and each having the 
> same target specification, being a node at a suitable presentation 
> location.
> Each button would then load and display another object at that 
> location (replacing the former content of only that node).
> This doesn't seem possible by the current specification (except by 
> JavaScript), or is it?
>
> Regards,
>
> Albert Jan wonnink
>
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org


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


More information about the x3d-public mailing list