This is the simple example code of setting navigations and viewpoints by using X3DOM Runtime API.
function setRuntime(typename, id)
{
/* ====================================================
Arguments: typename (string) -
To change mode or viewpoint.
walk() : Switches to walk mode.
examine() : Switches to examine mode.
lookAround() : Switches to lookAround mode.
lookAt() : Switches to lookAt mode.
resetView() : Navigates to the initial viewpoint.
uprightView() : Navigates to upright view.
showAll() : Zooms so that all objects are visible.
nextView() : Navigates to the next viewpoint.
prevView() : Navigates to the previous viewpoint.
Returns: The current mode or viewpoint.
Set mode or viewpoint of X3DOM element.
==================================================== */
var configure = document.getElementById(id);
switch (typename)
{
case "walk": configure.runtime.walk(); break;
case "fly": configure.runtime.fly(); break;
case "examine": configure.runtime.examine(); break;
case "lookAround": configure.runtime.lookAround(); break;
case "lookAt": configure.runtime.lookAt(); break;
case "game": configure.runtime.game(); break;
case "resetView": configure.runtime.resetView(); break;
case "uprightView": configure.runtime.uprightView(); break;
case "showAll": configure.runtime.showAll(); break;
case "nextView": configure.runtime.nextView(); break;
case "prevView": configure.runtime.prevView(); break;
case "upSpeed": setSpeed("up", id); break;
case "downSpeed": setSpeed("down", id); break
default: configure.runtime.examine();
}
getNavigationType(id);
}
And the experiment.
For more information about X3DOM Runtime API see: http://x3dom.org/docs/dev/api.html
You’ve got brought up a quite good details, regards for the post.