[X3D-Public] Xj3DNavigationUIManager Xj3DNavigationUIListener

JOHN COADY johncoady at shaw.ca
Mon Jul 12 10:43:30 PDT 2010


I would like to be able to set the navigation mode in an Xj3D applet using buttons in an html page. Xj3D provides the interface Xj3DNavigationUIManager which should allow me to do this. I called the function setNavigationState("FLY") on this interface and listen for a response from the Xj3D Browser using Xj3DNavigationUIListener. I get a response in selectedNavigationStateChanged  routine on the Xj3DNavigationUIListener indicating that the NavigationState has changed. However, when I try navigating in the scene I am still in the old navigation mode and not in the new one that I am trying to set. Am I doing something wrong or is the mechanism to set the Navigation Mode using Xj3DNavigationUIManager not functioning properly in Xj3D Browser?
 
Here is a site I put together to demonstate the problem.
 
http://dl.dropbox.com/u/5095342/Xj3DApplet/rc1/Xj3DApplet_RC1_test.html
 
In my applet code I am printing out a message to the Java Console when the navigation mode is set and also when the listener routine is called and this is what I get when I select the "fly" html button.
 
Set Navigation Mode to FLY
SelectedNavigationStateChanged to FLY 
 
Here are the routines I use output these messages when I set the navigation mode and when I hear back from Xj3D browser using the listener routine.

    public void selectedNavigationStateChanged(String state) {
        System.out.println("SelectedNavigationStateChanged to " + state);
    }

    public void fly() {
        Xj3DNavigationUIManager nav = browser.getNavigationManager();
        if (nav != null) {
            System.out.println("Set Navigation Mode to FLY");
            nav.setNavigationState("FLY");
        } else {
            System.out.println("Error: Unable to set Navigation Mode");
        }
    }

 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20100712/5202b909/attachment.html>


More information about the X3D-Public mailing list