[x3d-public] Duplicate x3d scenes shown in HTML.

Leonard Daly Leonard.Daly at realism.com
Thu Jun 15 06:34:33 PDT 2017


I know there is a followup email to this, but this one perhaps may be 
the easiest to answer...

If the exact same scene is displayed in two separate X3D "windows" on an 
HTML page, it comes down to how the X3D is handled.

If X3D is handled via pluggin, then as long as the plugin keeps the 
instances separate; there should not be an issue. I believe BS Contact 
works this way.

If the code is directly inline and displayed via a JavaScript-based 
engine (e.g., X3DOM and perhaps Cobweb), then it depends on the X3D 
code. If there is no use of the 'id' attribute then things should be 
handled separately. I know that X3DOM keeps an array of instances at the 
very top level. If the X3D code uses 'id', then the resultant HTML file 
is not valid as there are two occurrences of the same 'id'. But, this 
being HTML, the browser will not crash; but references to 'id' will not 
work separately.

In HTML there is only one namespace and namescope. All user-supplied 
HTML script code will need to correctly manage that there are two 
instances. It may be sufficient to use $('#x3d_instance_1 
transform).not('some-selection-criteria') and $('#x3d_instance_2 
transform).not('some-selection-criteria') to differentiate between the 
two instances when accessing X3D nodes from JavaScript code.


Leonard Daly


> What happens if duplicate x3d scenes are shown in HTML.   Are the 
> JavaScript variables shared, or are they made unique?
>
> Thanks,
>
> John
>
>
> _______________________________________________
> 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 Chair
President, Daly Realism - /Creating the Future/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170615/bb998c34/attachment.html>


More information about the x3d-public mailing list