[x3d-public] Anchor target within scene: code example

Albert Jan Wonnink awonnink at hotmail.com
Wed Jan 23 17:24:56 PST 2019


Hi Don,

the code behind the pages could be something like this


mainPage.x3d:
<X3D>
 <Scene>
 <!--first menu-->
  <Transform translation="-1 1 3">
   <!--first item-->
   <Transform translation="0 0 0">
    <Anchor url="'menu2_1.x3d'" parameter="'target=menu2'">
     <Shape …
    </Anchor>
 </Transform>
   <!--second item-->
   <Transform translation="0 -0.2 0">
    <Anchor url="'menu2_2.x3d'" parameter="'target=menu2'">
     <Shape …
    </Anchor>
 </Transform>
  <!--third item-->
...
</Transform>
<!--position menu2-->
<Transform translation="0 1 3">
  <Inline DEF="menu2"></Inline>
</Transform>

<!--position models to display-->
<Transform translation="1 1 3">
  <Inline DEF="modelsToDisplay"></Inline>
</Transform>
</Scene>
</X3D>




For each 'submenu' there is a separate file
menu2_1.x3d ( menu2_2.x3d, …)
<X3D>
 <Scene>
 <!--first menu-->
  <Transform>
   <!--first item-->
   <Transform translation="0 0 0">
    <Anchor url="'model_1.x3d'" parameter="'target=modelsToDisplay'">
     <Shape …
    </Anchor>
 </Transform>
   <!--second item-->
   <Transform translation="0 -0.2 0">
    <Anchor url="'menu2_2.x3d'" parameter="'target=modelsToDisplay'">
     <Shape …
    </Anchor>
 </Transform>
  <!--third item-->
...
</Transform>
</Scene>
</X3D>

And there are the files that actually contain the models:
model_1.x3d, model_2.x3d ...

I think the bottom line is to allow the 'target' parameter not only have the predefined values (_blank, _self etc.) or frame names of the html page, but also allow the names of the inlines as a target.

Regards,

Albert Jan

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190124/7ab38496/attachment-0001.html>


More information about the x3d-public mailing list